C4 Engine
C4 Engine API Documentation


Defined in:  TSMap.h
Adds an object to a map.

bool InsertMapElement(type *element);

element A pointer to the object to add to the map.
The InsertMapElement function adds the object specified by the element parameter to a map. If the object is a member of a different map of the same type, then it is first removed from that map before being added to the new map.

Only one object having a particular key value may be stored in a map at one time. If the key value associated with the element parameter is not found in the map, then the object is inserted, and true is returned. If a different object with the same key value is already in the map, then the new object is not inserted in the map and false is returned.
See Also