00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _WORLD_H
00021 #define _WORLD_H
00022
00023 #include <string>
00024 #include <vector>
00025
00026
00027 typedef std::vector<std::string> string_v;
00028
00029 class SmallHandler;
00030
00031
00033 class World
00034 {
00036 struct CELL
00037 {
00038 CELL(int x,int y,const std::string& name) : m_x(x)
00039 ,m_y(y),m_name(name)
00040 ,m_n(false),m_s(false),m_e(false),m_w(false) {
00041
00042 }
00043 int m_x;
00044 int m_y;
00045 std::string m_name;
00046 bool m_n;
00047 bool m_s;
00048 bool m_e;
00049 bool m_w;
00050 };
00051 typedef std::vector<CELL *> cell_v;
00052
00053 public:
00054 World(SmallHandler& );
00055 ~World();
00056
00057 void GetRandomLocation(int&,int&,std::string&);
00058 bool FindAt(int,int,std::string& );
00059 bool GetAt(int,int,std::string&,bool&,bool&,bool&,bool&);
00060
00061 void AddAt(int,int,const std::string& );
00062 SmallHandler& Handler() { return m_handler; }
00063
00064 void Open(int,int,const std::string& );
00065
00066 size_t NumberOfCells() { return m_cells.size(); }
00067
00068 private:
00069 SmallHandler& m_handler;
00070 cell_v m_cells;
00071 };
00072
00073
00074
00075
00076 #endif // _WORLD_H