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/Factory.h

    r258 r363  
    1717        public:
    1818            static Identifier* getIdentifier(const std::string& name);
     19            static Identifier* getIdentifier(const unsigned int id);
    1920            static void add(const std::string& name, Identifier* identifier);
     21            static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
    2022
    2123        private:
     
    2527
    2628            static Factory* pointer_s;
    27             std::map<std::string, Identifier*> identifierMap_;
     29            std::map<std::string, Identifier*> identifierStringMap_;
     30            std::map<unsigned int, Identifier*> identifierNetworkIDMap_;
    2831    };
    2932
Note: See TracChangeset for help on using the changeset viewer.