Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10294 in orxonox.OLD for branches/heathaze/src/story_entities


Ignore:
Timestamp:
Jan 18, 2007, 5:38:35 PM (18 years ago)
Author:
snellen
Message:

prepared scripted levelswitch

Location:
branches/heathaze/src/story_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/heathaze/src/story_entities/game_world.cc

    r9869 r10294  
    6464                        addMethod("setPlaymode", Executor1<GameWorld, lua_State*,const std::string&>(&GameWorld::setPlaymode))
    6565                        ->addMethod("setSoundtrack", Executor1<GameWorld, lua_State*, const std::string&>(&GameWorld::setSoundtrack))
     66                        ->addMethod("getStoryID", Executor0ret<StoryEntity, lua_State*, int>(&StoryEntity::getStoryID))
     67                        ->addMethod("setNextStoryName", Executor1ret<StoryEntity, lua_State*, bool, const std::string&>(&StoryEntity::setNextStoryName))
     68                        ->addMethod("stop", Executor0ret<GameWorld, lua_State*, bool>(&GameWorld::stop))
    6669                       );
    6770
  • branches/heathaze/src/story_entities/story_entity.cc

    r9869 r10294  
    132132  this->nextStoryID = nextStoryID;
    133133}
     134
     135
     136/**
     137 * sets the id of the next story entity by name
     138 * @param nextStoryName the story name of the next StoryEntity
     139 */
     140bool StoryEntity::setNextStoryName(const std::string& nextStoryName)
     141{
     142  for (ObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin();
     143       it != StoryEntity::objectList().end();
     144       ++it)
     145    if( (*it)->getName().compare(nextStoryName) == 0)
     146     {
     147      this->setNextStoryID( (*it)->getStoryID() );
     148      return true;
     149     }
     150     
     151     return false;
     152}
     153
    134154
    135155/**
  • branches/heathaze/src/story_entities/story_entity.h

    r9869 r10294  
    6767  const std::string& getLoadFile() const { return this->loadFile; }
    6868
     69  bool setNextStoryName(const std::string& nextStoryName);
    6970  void setNextStoryID(int nextStoryID);
    7071  /**  gets the story id of the current entity @returns story id */
Note: See TracChangeset for help on using the changeset viewer.