Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 19, 2009, 3:48:00 PM (16 years ago)
Author:
rgrieder
Message:

Merged orxonox_cast related revisions from core4 back to trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Identifier.cc

    r3280 r3325  
    4747    // ###       Identifier        ###
    4848    // ###############################
    49     int Identifier::hierarchyCreatingCounter_s = 0; // Set the static member variable hierarchyCreatingCounter_s to zero (this static member variable is ok: it's used in main(), not before)
     49    int Identifier::hierarchyCreatingCounter_s = 0;
     50    unsigned int Identifier::classIDCounter_s = 0;
    5051
    5152    /**
     
    5354    */
    5455    Identifier::Identifier()
     56        : classID_(classIDCounter_s++)
    5557    {
    5658        this->objects_ = new ObjectListBase(this);
     
    6769        this->directChildren_ = new std::set<const Identifier*>();
    6870
    69         // Use a static variable because the classID gets created before main() and that's why we should avoid static member variables
    70         static unsigned int classIDcounter_s = 0;
    71         this->classID_ = classIDcounter_s++;
     71        // Default network ID is the class ID
     72        this->networkID_ = this->classID_;
    7273    }
    7374
     
    244245    void Identifier::setNetworkID(uint32_t id)
    245246    {
    246         Factory::changeNetworkID(this, this->classID_, id);
    247         this->classID_ = id;
     247        Factory::changeNetworkID(this, this->networkID_, id);
     248        this->networkID_ = id;
    248249    }
    249250
Note: See TracChangeset for help on using the changeset viewer.