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

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

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

revision 1.4 by leiavoia, Wed Aug 20 18:21:58 2003 UTC revision 1.5 by leiavoia, Sun Sep 14 01:00:20 2003 UTC
# Line 118  int Map::GetRoadQ(int x, int y) { return Line 118  int Map::GetRoadQ(int x, int y) { return
118    
119    
120  // SET FUNCTIONS  // SET FUNCTIONS
121  void Map::SetObst(short int x, short int y, obstacle type) { the_map[x][y].obst = type; }  void Map::SetObst(short int x, short int y, obstacle type) {
122            if ( IsValid(x,y) == 0 ) { return; }
123            the_map[x][y].obst = type;
124            }
125    
126  bool Map::SetOccu(int x, int y, Pod& pod){  bool Map::SetOccu(int x, int y, Pod& pod){
127            if ( IsValid(x,y) == 0 ) { return 1; }
128          if (the_map[x][y].occu != NULL) {return 1;}          if (the_map[x][y].occu != NULL) {return 1;}
129          else {          else {
130                  the_map[x][y].occu = &pod;                  the_map[x][y].occu = &pod;
# Line 128  bool Map::SetOccu(int x, int y, Pod& pod Line 132  bool Map::SetOccu(int x, int y, Pod& pod
132                  }                  }
133          }          }
134    
135  void Map::UnsetOccu(int x, int y){ the_map[x][y].occu = NULL; }  void Map::UnsetOccu(int x, int y){
136            if ( IsValid(x,y) == 0 ) { return; }
137            the_map[x][y].occu = NULL;
138            }
139    
140    
141    
# Line 141  void Map::UnsetOccu(int x, int y){ the_m Line 148  void Map::UnsetOccu(int x, int y){ the_m
148    
149    
150  void Map::TrampleRoad(int x, int y, int a) { // a=1 if not defined  void Map::TrampleRoad(int x, int y, int a) { // a=1 if not defined
151            if ( IsValid(x,y) == 0 ) { return; }
152          the_map[x][y].road_q -= a;          the_map[x][y].road_q -= a;
153          if (the_map[x][y].road_q < 0) { the_map[x][y].road_q = 0;}          if (the_map[x][y].road_q < 0) { the_map[x][y].road_q = 0;}
154          }          }
155    
156    
157  void Map::DegradeRoad(int x, int y, int a) {  void Map::DegradeRoad(int x, int y, int a) {
158            if ( IsValid(x,y) == 0 ) { return; }
159          the_map[x][y].road_q += a;          the_map[x][y].road_q += a;
160          if (the_map[x][y].road_q > 9) { the_map[x][y].road_q = 9;}          if (the_map[x][y].road_q > 9) { the_map[x][y].road_q = 9;}
161          }          }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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