-
Notifications
You must be signed in to change notification settings - Fork 0
/
Video.h
105 lines (85 loc) · 5.1 KB
/
Video.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef _VIDEO_H_
#define _VIDEO_H_
//Incluimos la libreria string para poder utilizar la variable string
#include <string>
#include <vector>
//================================================================================================================================================
//================================================================================================================================================
//------------------------------------------------------------------------------------------------------------------------------------------------
// Clase base con el nombre "Video", esta sera la clase de la cual saldran las clases derivadas
class Video{
protected:
// Atributos
// Definimos los atributos con los que trabajaremos
std::string typeVideo;
std::string nameVideo;
std::string genre;
int calification;
int yearRelease;
float duration;
public:
// Constructores
// Constructor 1- Este constructor tendra todos los atributos que se definieron
Video(std::string _type, std::string _name, std::string _genre , int _calification, int _year , float _duration);
// Constructor 2- Este constructor tendra todos los atributos que se definieron excepto calificacion(Instrucciones de la entrega 1)
Video(std::string _type, std::string _name, std::string _genre , int _year , float _duration);
// Definimos los metodos con los que trabajaremos
// Getters y setter de cada atributo
std::string getTypeVideo();
void setTypeVideo(std::string _type);
std::string getNameVideo();
void setNameVideo(std::string _name);
std::string getGenre();
void setGenre(std::string _genre);
int getCalification();
void setCalification(int _calification);
int getYearRelease();
void setYearRelease(int _year);
float getDuration();
void setDuration(int _duration);
// Funciones de calificar video y mostrar datos
void rateVideo(int _rate);
// Se usa la funcion virtual para hacer poliformismo ya que usaremos una funcion del mismo nombre para las clases derivadas
virtual void showData();
};
//================================================================================================================================================
//================================================================================================================================================
//------------------------------------------------------------------------------------------------------------------------------------------------
// Primer clase derivada con el nombre "Pelicula" para los videos de peliculas
class Pelicula:public Video{
private:
int nominations;
public:
// Constructores
// Constructor 1- Este constructor tendra todos los atributos que se definieron en la clase base
Pelicula(std::string _type, std::string _name, std::string _gender , int _calification, int _year , float _duration,int _nominations);
// Constructor 2- Este constructor tendra todos los atributos que se definieron en la clase base excepto calificacion(Instrucciones de la entrega 1)
Pelicula(std::string _type, std::string _name, std::string _gender , int _year , float _duration);
// Definimos los metodos con los que trabajaremos
// Getters y setter de cada atributo
int getNominations();
void setNominations(int _nominations);
// Metodo para mostrar la informacion de la clase derivada Pelicula
void showData();
};
//================================================================================================================================================
//================================================================================================================================================
//------------------------------------------------------------------------------------------------------------------------------------------------
// Segunda clase derivada con el nombre "Serie" para los videos de series
class Serie:public Video{
private:
int numEpisodes;
public:
// Constructores
// Constructor 1- Este constructor tendra todos los atributos que se definieron en la clase base
Serie(std::string _type, std::string _name, std::string _gender , int _calification, int _year , float _duration,int _numEpisodes);
// Constructor 2- Este constructor tendra todos los atributos que se definieron en la clase base excepto calificacion(Instrucciones de la entrega 1)
Serie(std::string _type, std::string _name, std::string _gender , int _year , float _duration);
// Definimos los metodos con los que trabajaremos
// Getters y setter de cada atributo
int getNumEpisodes();
void setNumEpisodes(int _numEpisodes);
// Metodo para mostrar la informacion de la clase derivada Serie
void showData();
};
#endif