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

negociacion.h

00001 /***********************************************************************************
00002  *  CLASE NEGOCIACIÓN
00003  *  Clase que representa una negociación entre dos jugadores. 
00004  *  Una negociación puede incluir tarjetas y propiedades y debe darse entre dos y sólo
00005  *  dos jugadores.
00006  *
00007  *  Requiere:
00008  *     - clase propiedad ( jerarquia )
00009  *     - clase tarjeta
00010  *     - clase jugador
00011  *     - clase list (STL)
00012  *     - clase string (STL) 
00013  *
00014  *  Autor: Javier Aragón Zabalegui (PFC para la uc3m: street Master's)
00015  *  Contacto: 100039831@alumnos.uc3m.es
00016  *  version 1.0
00017  **********************************************************************************/
00018 
00019 #ifndef __NEGOCIACION__
00020 #define __NEGOCIACION__
00021 
00022 #include "propiedad.h"
00023 #include "tarjeta.h"
00024 #include "jugador.h"
00025 #include <list>
00026 #include <string>
00027 using namespace std;
00028 
00029 class negociacion {
00030 
00031  private: 
00032   
00033   //Atributos
00037   long _dineroEfectivo;
00038   long _dineroEfectivoPedido;
00039   
00043   jugador *_emisor;
00044   jugador *_receptor;
00045 
00049   list<propiedad*> _propiedadesOfertadas;
00050   list<tarjeta*> _tarjetasOfertadas;
00051 
00055   list<propiedad*> _propiedadesPedidas;
00056   list<tarjeta*> _tarjetasPedidas;
00057 
00058  public:   
00059   // Constructores
00060   negociacion ();
00061   negociacion ( long dineroEfectivo,  long dineroEfectivoPedido, jugador *emisor, jugador *receptor, 
00062                 list<propiedad*> propiedadesOfertadas, list<tarjeta*> tarjetasOfertadas, list<propiedad*> propiedadesPedidas,
00063                 list<tarjeta*> tarjetasPedidas );
00064   // Copy constructor
00065   negociacion (const negociacion& right);
00066 
00067   // Operador de asignacion
00068   negociacion& negociacion::operator= (const negociacion& right);
00069 
00070   // Sobrecarga del operador de salida
00071   friend ostream& operator<< ( ostream &os, negociacion* n );
00072   
00073   //Destructor
00074   ~negociacion ();
00075 
00076   // Métodos GET
00077   long get_dineroEfectivo () const;
00078   long get_dineroEfectivoPedido () const;
00079   jugador* get_emisor () const;
00080   jugador* get_receptor () const;
00081   list<propiedad*> get_propiedadesOfertadas () const;
00082   list<propiedad*> get_propiedadesPedidas () const;
00083   list<tarjeta*> get_tarjetasOfertadas () const;
00084   list<tarjeta*> get_tarjetasPedidas () const;
00085   
00086   // Métodos SET
00087   void set_dineroEfectivo ( long dineroEfectivo );
00088   void set_dineroEfectivoPedido ( long dineroEfectivo );
00089   void set_emisor ( jugador *emisor );
00090   void set_receptor ( jugador *receptor );
00091   void set_propiedadesOfertadas ( list<propiedad*> propiedadesOfertadas );
00092   void set_propiedadesPedidas ( list<propiedad*> propiedadesPedidas );
00093   void set_tarjetasOfertadas ( list<tarjeta*> tarjetasOfertadas );
00094   void set_tarjetasPedidas ( list<tarjeta*> tarjetasPedidas );
00095 
00103   int negociar ();
00104   
00108   int ofrecer ();
00109 
00114   int pedir ();
00115   
00119   void distribuirBienes ();  
00120   
00124   string verPropiedadesOfertadas ();
00125 
00129   string verPropiedadesPedidas ();
00130 
00134   bool propiedadOfertadaIncluida ( propiedad *p );
00135 
00139   bool propiedadPedidaIncluida ( propiedad *p );
00140 
00146   void incluirPropiedadesOfertadas ( );
00147 
00153   void incluirPropiedadesPedidas ( );
00154 
00161   int nuevaPropiedadOfertada ( propiedad *p );
00162 
00169   int nuevaPropiedadPedida ( propiedad *p );
00170   
00174   void anyadirPropiedadOfertada ( propiedad *p );
00175 
00179   void anyadirPropiedadPedida ( propiedad *p );    
00180   
00184   void incluirTarjetasOfertadas ( int i );
00185 
00189   void incluirTarjetasPedidas ( int i );
00190 
00194   void anyadirTarjetaOfertada ( tarjeta *t );
00195 
00199   void anyadirTarjetaPedida ( tarjeta *t );
00200 };
00201 
00202 //GET:
00203 
00204 inline long negociacion::get_dineroEfectivo () const
00205 {
00206   return _dineroEfectivo;
00207 }
00208 
00209 inline long negociacion::get_dineroEfectivoPedido () const
00210 {
00211   return _dineroEfectivoPedido;
00212 }
00213 
00214 inline jugador *negociacion::get_emisor () const
00215 {
00216   return _emisor;
00217 }
00218 
00219 inline jugador *negociacion::get_receptor () const
00220 {
00221   return _receptor;
00222 }
00223 
00224 inline list<propiedad*> negociacion::get_propiedadesOfertadas () const
00225 {
00226   return _propiedadesOfertadas;
00227 }
00228 
00229 inline list<propiedad*> negociacion::get_propiedadesPedidas () const
00230 {
00231   return _propiedadesPedidas;
00232 }
00233 
00234 inline list<tarjeta*> negociacion::get_tarjetasOfertadas () const
00235 {
00236   return _tarjetasOfertadas;
00237 }
00238 
00239 inline list<tarjeta*> negociacion::get_tarjetasPedidas () const
00240 {
00241   return _tarjetasPedidas;
00242 }
00243 
00244 //SET:
00245 
00246 inline void negociacion::set_dineroEfectivo ( long dineroEfectivo )
00247 {
00248   _dineroEfectivo = dineroEfectivo;
00249 }
00250 
00251 inline void negociacion::set_dineroEfectivoPedido ( long dineroEfectivo )
00252 {
00253   _dineroEfectivoPedido = dineroEfectivo;
00254 }
00255 
00256 
00257 inline void negociacion::set_emisor ( jugador *emisor )
00258 {
00259   _emisor = emisor;
00260 }
00261 
00262 inline void negociacion::set_receptor ( jugador *receptor )
00263 {
00264   _receptor = receptor;
00265 }
00266 
00267 inline void negociacion::set_propiedadesOfertadas ( list<propiedad*> propiedadesOfertadas )
00268 {
00269   _propiedadesOfertadas = propiedadesOfertadas;
00270 }
00271 
00272 inline void negociacion::set_propiedadesPedidas ( list<propiedad*> propiedadesPedidas )
00273 {
00274   _propiedadesPedidas = propiedadesPedidas;
00275 }
00276 
00277 inline void negociacion::set_tarjetasOfertadas ( list<tarjeta*> tarjetasOfertadas )
00278 {
00279   _tarjetasOfertadas = tarjetasOfertadas;
00280 }
00281 
00282 inline void negociacion::set_tarjetasPedidas ( list<tarjeta*> tarjetasPedidas )
00283 {
00284   _tarjetasPedidas = tarjetasPedidas;
00285 }
00286 
00287 
00288 #endif

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