/[projectaxis]/projectaxis/projectAxis/src/blotchmaker/map.cpp
ViewVC logotype

Diff of /projectaxis/projectAxis/src/blotchmaker/map.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by vovansim, Tue Apr 22 22:43:26 2003 UTC revision 1.2 by leiavoia, Wed May 28 02:38:07 2003 UTC
# Line 41  for (int counter = 0; counter < cols; co Line 41  for (int counter = 0; counter < cols; co
41  for (int counter = 0; counter < map_rows; counter++ ) {  for (int counter = 0; counter < map_rows; counter++ ) {
42          for (int counterB = 0; counterB < map_cols; counterB++ ) {          for (int counterB = 0; counterB < map_cols; counterB++ ) {
43                  the_map[counterB][counter].obst = EMPTY;                  the_map[counterB][counter].obst = EMPTY;
44                    the_map[counterB][counter].occu = NULL;
45                  }                  }
46          }          }
47  }  }
# Line 105  return int(the_map[x][y].obst); Line 106  return int(the_map[x][y].obst);
106  //////////////////////////////////////////////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////////////////////////////////////////////
107    
108    
109    void Map::SetOccu(int x, int y, Pod& pod){
110            the_map[x][y].occu = &pod;
111            }
112    
113    
114    //////////////////////////////////////////////////////////////////////////////////////////////////////////
115    
116    
117    void Map::UnsetOccu(int x, int y){
118            the_map[x][y].occu = NULL;
119            }
120    
121    
122    //////////////////////////////////////////////////////////////////////////////////////////////////////////
123    
124    
125    Pod* Map::GetOccu(int x, int y){
126            return (the_map[x][y].occu);
127            }
128    
129    
130    //////////////////////////////////////////////////////////////////////////////////////////////////////////
131    
132    
133  bool Map::IsValid (short int x, short int y) {  bool Map::IsValid (short int x, short int y) {
134  // Returns 1 if a valid map coord is passed, zero if not.  // Returns 1 if a valid map coord is passed, zero if not.
135  // x/y coords  // x/y coords
# Line 126  cout << '\n'; Line 151  cout << '\n';
151  for (int counter = 0; counter < map_rows; counter++ ) {  for (int counter = 0; counter < map_rows; counter++ ) {
152          cout << '*';          cout << '*';
153          for (int counterB = 0; counterB < map_cols; counterB++ ) {          for (int counterB = 0; counterB < map_cols; counterB++ ) {
154                  if ( the_map[counterB][counter].obst == 0 ) {cout << ' ';}                  if ( the_map[counterB][counter].occu != NULL ) {cout << '.';}
155                    else if ( the_map[counterB][counter].obst == 0 ) {cout << ' ';}
156                  else if ( the_map[counterB][counter].obst == 1 ) {cout << 'X';}                  else if ( the_map[counterB][counter].obst == 1 ) {cout << 'X';}
157                  else if ( the_map[counterB][counter].obst == 2 ) {cout << '~';}                  else if ( the_map[counterB][counter].obst == 2 ) {cout << '~';}
158                  else if ( the_map[counterB][counter].obst == 3 ) {cout << '+';}                  else if ( the_map[counterB][counter].obst == 3 ) {cout << '+';}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26