A hash map to have direct access to an Object in a Scene.
More...
#include <C_scene.hpp>
|
|
using | Map = std::unordered_map<ObjectSid, ObjectContainer::iterator> |
|
|
| ObjectContainerHashMap (ObjectContainer &objects) |
|
| ObjectContainerHashMap (ObjectContainerHashMap const &r)=delete |
|
| ObjectContainerHashMap (ObjectContainerHashMap &&r) noexcept=default |
|
ObjectContainerHashMap & | operator= (ObjectContainerHashMap const &r)=delete |
|
ObjectContainerHashMap & | operator= (ObjectContainerHashMap &&r) noexcept=default |
|
void | clear () |
|
void | reMap (ObjectContainer &objects) |
| bool | newSid (ObjectSid oldSid, ObjectSid newSid) |
| | Announce a new SID for an Object.
|
| bool | newObject (ObjectSid sid, ObjectContainer::iterator it) |
| | Announce a new Object in the hash map.
|
| void | delObject (ObjectSid sid) |
| | Announce the deletion of an Object.
|
|
std::optional< ObjectContainer::iterator > | find (ObjectSid sid) |
|
std::optional< ObjectContainer::const_iterator > | find (ObjectSid sid) const |
|
fge::ObjectContainer::value_type | retrieve (ObjectSid sid) const |
|
bool | contains (ObjectSid sid) const |
|
std::size_t | size () const |
A hash map to have direct access to an Object in a Scene.
◆ delObject()
| void fge::ObjectContainerHashMap::delObject |
( |
ObjectSid | sid | ) |
|
Announce the deletion of an Object.
- Parameters
-
◆ newObject()
| bool fge::ObjectContainerHashMap::newObject |
( |
ObjectSid | sid, |
|
|
ObjectContainer::iterator | it ) |
|
nodiscard |
Announce a new Object in the hash map.
If return false, the Scene will call the reMap method as something went wrong.
- Parameters
-
| sid | The SID of the Object |
| it | A valid iterator of the Object from the ObjectContainer |
- Returns
- true if the Object is added, false otherwise
◆ newSid()
| bool fge::ObjectContainerHashMap::newSid |
( |
ObjectSid | oldSid, |
|
|
ObjectSid | newSid ) |
|
nodiscard |
Announce a new SID for an Object.
If return false, the Scene will call the reMap method as something went wrong.
- Parameters
-
| oldSid | The old SID of the Object |
| newSid | The new SID of the Object |
- Returns
- true if the SID is changed, false otherwise
The documentation for this class was generated from the following file: