Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7412 in orxonox.OLD for trunk/src/world_entities/playable.cc


Ignore:
Timestamp:
Apr 28, 2006, 12:03:54 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Another CompletionMode is working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.cc

    r7356 r7412  
    563563Playable::Playmode Playable::stringToPlaymode(const std::string& playmode)
    564564{
    565   if (playmode == "Vertical")
     565  if (playmode == Playable::playmodeNames[0])
    566566    return Playable::Vertical;
    567   if (playmode == "Horizontal")
     567  if (playmode == Playable::playmodeNames[1])
    568568    return Playable::Horizontal;
    569   if (playmode == "FromBehind")
     569  if (playmode == Playable::playmodeNames[2])
    570570    return Playable::FromBehind;
    571   if (playmode == "Full3D")
     571  if (playmode == Playable::playmodeNames[3])
    572572    return Playable::Full3D;
    573573
     
    581581 * @returns the String.
    582582 */
    583 const char* Playable::playmodeToString(Playable::Playmode playmode)
     583const std::string& Playable::playmodeToString(Playable::Playmode playmode)
    584584{
    585585  switch(playmode)
    586586  {
    587587    case Playable::Vertical:
    588       return "Vertical";
     588      return Playable::playmodeNames[0];
    589589    case Playable::Horizontal:
    590       return "Horizontal";
     590      return Playable::playmodeNames[1];
    591591    case Playable::FromBehind:
    592       return "FromBehind";
     592      return Playable::playmodeNames[2];
    593593    case Playable::Full3D:
    594       return "Full3D";
     594      return Playable::playmodeNames[3];
    595595
    596596    default:
    597       return "Full3D";
    598   }
    599 
    600 }
     597      return Playable::playmodeNames[3];
     598  }
     599}
     600
     601/**
     602 * @brief PlaymodeNames
     603 */
     604const std::string Playable::playmodeNames[] =
     605{
     606  "Vertical",
     607  "Horizontal",
     608  "FromBehind",
     609  "Full3D"
     610};
Note: See TracChangeset for help on using the changeset viewer.