00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef containercontrolsH
00019 #define containercontrolsH
00020
00021 #include "containerbase.h"
00022
00023 class VehicleMovement;
00024 class Player;
00025 class GameMap;
00026
00027 class ContainerConstControls {
00028 const ContainerBase* container;
00029
00030 const Player& getPlayer() const;
00031 const GameMap* getMap() const;
00032 public:
00033 ContainerConstControls( const ContainerBase* cb ) : container( cb ) {};
00034
00035 bool unitProductionAvailable() const;
00036
00038 int unitProductionPrerequisites( const Vehicletype* type ) const;
00039
00040 };
00041
00042 class ContainerControls : public ContainerConstControls {
00043 ContainerBase* container;
00044
00045 GameMap* getMap();
00046 Player& getPlayer();
00047 int getPlayerNum();
00048
00049 public:
00050 ContainerControls( ContainerBase* cb ) : ContainerConstControls( cb ), container( cb ) {};
00051 static VehicleMovement* movement ( Vehicle* eht, bool simpleMode = false);
00052
00053
00054 Vehicle* produceUnit( const Vehicletype* type, bool fillWithAmmo, bool fillWithResources );
00055
00056 Resources calcDestructionOutput( Vehicle* veh );
00057 void destructUnit( Vehicle* veh );
00058
00059 bool unitTrainingAvailable( Vehicle* veh );
00060 void trainUnit( Vehicle* veh );
00061
00062 vector<const Vehicletype*> productionLinesBuyable();
00063
00064 Resources buildProductionLineResourcesNeeded( const Vehicletype* veh );
00065 int buildProductionLine( const Vehicletype* veh );
00066
00067 Resources removeProductionLineResourcesNeeded( const Vehicletype* veh );
00068 int removeProductionLine( const Vehicletype* veh );
00069
00071 Vehicle* produceUnitHypothetically( const Vehicletype* type );
00072
00073 void fillResource (Vehicle* eht, int resourcetype, int newamount);
00074 void fillAmmo (Vehicle* eht, int weapon, int newa );
00075 void refilleverything ( Vehicle* eht );
00076 void refillAmmo ( Vehicle* veh );
00077 void refillResources ( Vehicle* veh );
00078 void emptyeverything ( Vehicle* eht );
00079 int getammunition ( int weapontype, int num, bool abbuchen, bool produceifrequired );
00080 bool ammotypeavail ( int type );
00081 int ammoProducable ( int weaptype, int num );
00082 int produceAmmo ( int weaptype, int num );
00083
00084 bool moveUnitUpAvail( const Vehicle* veh );
00085 bool moveUnitUp( Vehicle* veh );
00086
00087 bool moveUnitDownAvail( const Vehicle* movingUnit );
00088 bool moveUnitDownAvail( const Vehicle* movingUnit, const Vehicle* newTransport );
00089 vector<Vehicle*> moveUnitDownTargets( const Vehicle* movingUnit );
00090 bool moveUnitDown( Vehicle* veh, Vehicle* newTransport );
00091
00092 };
00093
00094 #endif