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

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

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

revision 1.1 by leiavoia, Sat Aug 9 18:36:59 2003 UTC revision 1.2 by leiavoia, Wed Aug 20 18:19:48 2003 UTC
# Line 11  axis.cpp Line 11  axis.cpp
11    
12  // STATICS  // STATICS
13  std::vector<Axis*> Axis::axes;  std::vector<Axis*> Axis::axes;
14  int Axis::id_counter;  int Axis::id_counter = 0;
15    
16    
17    
# Line 21  int Axis::id_counter; Line 21  int Axis::id_counter;
21    
22  // *STRUCTORS -------------------\/-------------------  // *STRUCTORS -------------------\/-------------------
23  Axis::Axis(axis_color c, bool is_human) {  Axis::Axis(axis_color c, bool is_human) {
24          id = id_counter++; // another player enters the fray!          id = id_counter; // another player enters the fray!
25            id_counter++;
26    
27          AddAxis(this);          AddAxis(this);
28          color = c;          color = c;
29          human = is_human;          human = is_human;
# Line 124  bool Axis::IsHuman() { return human;} Line 126  bool Axis::IsHuman() { return human;}
126    
127    
128    
129    
130    
131    
132    std::string Axis::TranslateAxisColor(axis_color c) {
133            switch (c) {
134                    case AXISCOLOR_R: return "red"; break;
135                    case AXISCOLOR_O: return "orange"; break;
136                    case AXISCOLOR_Y: return "yellow"; break;
137                    case AXISCOLOR_G: return "green"; break;
138                    case AXISCOLOR_BL: return "blue"; break;
139                    case AXISCOLOR_V: return "violet"; break;
140                    case AXISCOLOR_W: return "white"; break;
141                    case AXISCOLOR_BK: return "black"; break;
142                    }
143            }
144    
145    
146    axis_color Axis::TranslateAxisColor(const char* c) {
147            if (strcmp("red",c) == 0) {  return AXISCOLOR_R; }
148            else if (strcmp("orange",c) == 0) {  return AXISCOLOR_O; }
149            else if (strcmp("yellow",c) == 0) {  return AXISCOLOR_Y; }
150            else if (strcmp("green",c) == 0) {  return AXISCOLOR_G; }
151            else if (strcmp("blue",c) == 0) {  return AXISCOLOR_BL; }
152            else if (strcmp("violet",c) == 0) {  return AXISCOLOR_V; }
153            else if (strcmp("white",c) == 0) {  return AXISCOLOR_W; }
154            else if (strcmp("black",c) == 0) {  return AXISCOLOR_BK; }
155            else {  return AXISCOLOR_R; }
156            }
157    
158    
159    

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