00001 #ifndef __TILE_H 00002 #define __TILE_H 00003 00004 #include "building.h" 00005 #include "tool.h" 00006 #include "util.h" 00007 00008 enum Resource {CHEMICALS, ENERGY, PLATES, MONEY, OIL, IRON, FOOD, WATER, NUMRESOURCES}; 00009 enum TileType {ROCK, WATER_T, NO_TYPE_TILE}; 00010 00011 class Tile { 00012 public: 00013 Tile(TileType t=NO_TYPE_TILE, bool occupiable=false); 00014 ~Tile(); 00015 00016 Tile& operator=(const Tile& t); 00017 TileType getType(); 00018 bool isOccupiable(); 00019 bool isResourceAvail(Resource r); 00020 int getResource(Resource r); 00021 Building& getBuilding(); 00022 ToolType getToolType() const {return tool_type;}; 00023 00024 void setType(TileType t); 00025 void setOccupiable(bool o); 00026 void setResourceAvail(Resource r, bool b); 00027 void setResource(Resource r, int amount); 00028 void decreaseResource(Resource r, int amount); 00029 void setBuilding(Building& b); 00030 void setToolType(ToolType t); 00031 00032 private: 00033 static Building nullBuilding; 00034 TileType type; 00035 ToolType tool_type; 00036 bool occupiable; 00037 bool resources[NUMRESOURCES]; 00038 int amountOfResources[NUMRESOURCES]; 00039 Building& building; 00040 }; 00041 00042 #endif