Página principal | Lista de namespace | Lista de archivos

tarjeta.h

00001 /***********************************************************************************
00002  *  CLASE TARJETA
00003  *  \brief Clase que reperesenta una tarjeta del juego monopoly. Una tarjeta estará formada por
00004  *  un conjunto de acciones y pertenecerá a un único mazo o baraja.
00005  *
00006  *  Requiere:
00007  *     - clase string
00008  *     - clase vector
00009  *     - clase iostream
00010  *
00011  *  Autor: Javier Aragón Zabalegui (PFC para la uc3m: street Master's)
00012  *  Contacto: 100039831@alumnos.uc3m.es
00013  *  version 1.0
00014  **********************************************************************************/
00015 
00016 
00017 #ifndef __TARJETA__
00018 #define __TARJETA__
00019 
00020 
00021 #include "accion.h"
00022 #include "cadenas.h"
00023 
00024 #include <string>
00025 #include <vector>
00026 #include <iostream>
00027 using namespace std;
00028 
00029 
00030 class tarjeta {
00031 
00032  private:
00033 
00034   //Atributos
00035   int _numero;
00036   string _texto;
00037   bool _disponible;
00038   string _tipoMazo;
00039   
00040   //Asociaciones
00041   vector <accion> _accion;
00042 
00043  public:
00044 
00045   // Constructor por defecto
00046   tarjeta ();
00047   
00048   // Constructor explícito
00049   tarjeta ( int numero, string texto, bool disponible, string tipoMazo );
00050   
00051   // Copy constructor
00052   tarjeta ( const tarjeta& right );
00053 
00054   // Operador de asignación
00055   tarjeta& operator= (const tarjeta& right);
00056 
00057   friend ostream& operator<< ( ostream& os, tarjeta *tjt );
00058 
00059   // Destructor
00060   ~tarjeta ();
00061 
00062   // Métodos GET
00063   int get_numero () const;
00064   string get_texto () const;
00065   bool get_disponible () const;
00066   string get_tipoMazo () const;
00067 
00068   // Métodos SET
00069   void set_numero ( int numero );
00070   void set_texto ( string texto );
00071   void set_disponible ( bool disponible );
00072   void set_tipoMazo ( string tipoMazo );
00073 
00074   //Otros métodos
00075 
00079   void incluirAccion ( int pay, int advance, int advanceto, int payeach, 
00080                        int payhouse, int payhotel, int multiPago, bool nextutil, bool tojail,
00081                        bool nextrr, bool jailcard, bool cobrarSalida, int multiPagoDado, 
00082                        bool nextPropiedad );
00083 
00087   int get_numeroOpciones ();
00088 
00092   int ejecutar ( jugador* player );
00093 
00098   int buscarAccionCarcel ();
00099 
00104   int buscarCobrar ();
00105 };
00106 
00107 inline int tarjeta::get_numero () const
00108 {
00109   return _numero;
00110 }
00111 
00112 inline string tarjeta::get_texto () const
00113 {
00114   return _texto;
00115 }
00116 
00117 inline bool tarjeta::get_disponible () const
00118 {
00119   return _numero;
00120 }
00121 
00122 inline string tarjeta::get_tipoMazo () const
00123 {
00124   return _tipoMazo;
00125 }
00126 
00127 inline void tarjeta::set_numero ( int numero )
00128 {
00129   _numero = numero;
00130 }
00131 
00132 inline void tarjeta::set_texto( string texto )
00133 {
00134   _texto = texto;
00135 }
00136 
00137 inline void tarjeta::set_disponible ( bool disponible )
00138 {
00139   _disponible = disponible;
00140 }
00141 
00142 inline void tarjeta::set_tipoMazo ( string tipoMazo )
00143 {
00144   _tipoMazo = tipoMazo;
00145 }
00146 
00147 #endif

Generado el Fri Jun 30 12:38:29 2006 para Street Master's por  doxygen 1.3.9.1