Changeset 7412 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Apr 28, 2006, 12:03:54 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7356 r7412 563 563 Playable::Playmode Playable::stringToPlaymode(const std::string& playmode) 564 564 { 565 if (playmode == "Vertical")565 if (playmode == Playable::playmodeNames[0]) 566 566 return Playable::Vertical; 567 if (playmode == "Horizontal")567 if (playmode == Playable::playmodeNames[1]) 568 568 return Playable::Horizontal; 569 if (playmode == "FromBehind")569 if (playmode == Playable::playmodeNames[2]) 570 570 return Playable::FromBehind; 571 if (playmode == "Full3D")571 if (playmode == Playable::playmodeNames[3]) 572 572 return Playable::Full3D; 573 573 … … 581 581 * @returns the String. 582 582 */ 583 const char*Playable::playmodeToString(Playable::Playmode playmode)583 const std::string& Playable::playmodeToString(Playable::Playmode playmode) 584 584 { 585 585 switch(playmode) 586 586 { 587 587 case Playable::Vertical: 588 return "Vertical";588 return Playable::playmodeNames[0]; 589 589 case Playable::Horizontal: 590 return "Horizontal";590 return Playable::playmodeNames[1]; 591 591 case Playable::FromBehind: 592 return "FromBehind";592 return Playable::playmodeNames[2]; 593 593 case Playable::Full3D: 594 return "Full3D";594 return Playable::playmodeNames[3]; 595 595 596 596 default: 597 return "Full3D"; 598 } 599 600 } 597 return Playable::playmodeNames[3]; 598 } 599 } 600 601 /** 602 * @brief PlaymodeNames 603 */ 604 const std::string Playable::playmodeNames[] = 605 { 606 "Vertical", 607 "Horizontal", 608 "FromBehind", 609 "Full3D" 610 }; -
trunk/src/world_entities/playable.h
r7351 r7412 33 33 FromBehind = 4, //!< Seen from behind (move in z-y) 34 34 Full3D = 8, //!< Full featured 3D-mode. (move in all directions x-y-z) 35 36 PlaymodeCount = 4, 35 37 } Playmode; 36 38 … … 87 89 // Transformations: 88 90 static Playable::Playmode stringToPlaymode(const std::string& playmode); 89 static const char* playmodeToString(Playable::Playmode playmode); 91 static const std::string& playmodeToString(Playable::Playmode playmode); 92 static const std::string playmodeNames[]; 93 90 94 protected: 91 95 Playable();
Note: See TracChangeset
for help on using the changeset viewer.