Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2007, 1:20:20 AM (16 years ago)
Author:
landauf
Message:

added NetworkID

small tutorial for oli and dumeni:
every Identifier generates its own NetworkID, but it can be changed:

→ (Identifier)→setNetworkID(unsigned int)

be careful: after changing the NetworkID, there are probably 2 Identifiers with the same ID, so always change ALL Identifiers before using ID(unsigned int).

get an Identifier with a specific NetworkID:

→ ID(unsigned int)

get the name:

→ ID(unsigned int)→getName()

create an object:

→ ID(unsigned int)→fabricate()

get an Identifier with a specific name:

→ ID(std::string&)

get the NetworkID:

→ ID(std::string&)→getNetworkID()

create an object:

→ ID(std::string&)→fabricate()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/Identifier.h

    r346 r363  
    88#include "Factory.h"
    99
    10 #define HIERARCHY_VERBOSE 0
     10#define HIERARCHY_VERBOSE false
    1111
    1212
     
    4343
    4444            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
     45
     46            inline const unsigned int getNetworkID() const { return this->classID_; }
     47            void setNetworkID(unsigned int id);
    4548
    4649        private:
     
    7477            bool bCreatedOneObject_;
    7578            static int hierarchyCreatingCounter_s;
     79            static unsigned int classIDcounter_s;
     80            unsigned int classID_;
    7681    };
    7782
Note: See TracChangeset for help on using the changeset viewer.