Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 9, 2009, 4:54:31 PM (15 years ago)
Author:
scheusso
Message:

2 new console commands (startIOConsole, printObjects)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/gamestates/GSRoot.cc

    r5876 r5918  
    4141{
    4242    DeclareGameState(GSRoot, "root", false, false);
     43    SetConsoleCommandShortcut(GSRoot, printObjects);
    4344
    4445    GSRoot::GSRoot(const GameStateInfo& info)
     
    5354    {
    5455        NetworkFunctionBase::destroyAllNetworkFunctions();
     56    }
     57   
     58    void GSRoot::printObjects()
     59    {
     60        unsigned int nr=0;
     61        for(ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it){
     62            if( dynamic_cast<Synchronisable*>(*it) )
     63                COUT(0) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << std::endl;
     64            else
     65                COUT(0) << "object: " << it->getIdentifier()->getName() << std::endl;
     66            nr++;
     67        }
     68        COUT(0) << "currently got " << nr << " objects" << std::endl;
     69   
    5570    }
    5671
Note: See TracChangeset for help on using the changeset viewer.