BWAPI
SPAR/AIModule/SparAIModule/DecisionMaking/Layer2Actions/Interface/ActionResources.h
Go to the documentation of this file.
00001 #pragma once
00002 #include "../../../Utils/Resources.h"
00003 #include "../../../PerceptualState/Locations/Static/StaticLocation.h"
00004 
00005 class ActionResources
00006 {
00007 public:
00008   ActionResources()
00009     : m_buildingLocation(NULL)
00010     , m_buildingType(BWAPI::UnitTypes::None)
00011   {}
00012   ActionResources(int minerals, int gas, int supply)
00013     : m_resources(static_cast<double>(minerals), 
00014                   static_cast<double>(gas),
00015                   static_cast<double>(supply))
00016     , m_buildingLocation(NULL)
00017     , m_buildingType(BWAPI::UnitTypes::None)
00018   {}
00019   ActionResources(const Resources& resources)
00020     : m_resources(resources)
00021     , m_buildingLocation(NULL)
00022     , m_buildingType(BWAPI::UnitTypes::None)
00023   {}
00024   ActionResources(int minerals, int gas, int supply, StaticLocation* buildingLocation, BWAPI::UnitType buildingType)
00025     : m_resources(static_cast<double>(minerals), 
00026                   static_cast<double>(gas),
00027                   static_cast<double>(supply))
00028     , m_buildingLocation(buildingLocation)
00029     , m_buildingType(buildingType)
00030   {}
00031   ActionResources(const Resources& resources, StaticLocation* buildingLocation, BWAPI::UnitType buildingType)
00032     : m_resources(resources)
00033     , m_buildingLocation(buildingLocation)
00034     , m_buildingType(buildingType)
00035   {}
00036 
00037   
00038   bool operator==(const ActionResources& resources)
00039   {
00040     return (resources.m_resources == m_resources && resources.m_buildingLocation == m_buildingLocation);
00041   }
00042 
00043   double getMinerals() const
00044   {
00045     return m_resources.getMinerals();
00046   }
00047 
00048   double getGas() const
00049   {
00050     return m_resources.getGas();
00051   }
00052 
00053   double getSupply() const
00054   {
00055     return m_resources.getSupply();
00056   }
00057 
00058   Resources getResources() const
00059   {
00060     return m_resources;
00061   }
00062 
00063   StaticLocation* getBuildingLocation() const
00064   {
00065     return m_buildingLocation;
00066   }
00067 
00068   BWAPI::UnitType getBuildingType() const
00069   {
00070     return m_buildingType;
00071   }
00072 
00073 protected:
00074   Resources m_resources;
00075   StaticLocation* m_buildingLocation;
00076   BWAPI::UnitType m_buildingType;
00077 };
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines