|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Base class for all identifiable objects in the component system. More...
#include <Part.h>
Public Member Functions | |
| Part () | |
| Constructs a Part and assigns it a unique ID. | |
| Part (std::shared_ptr< Context > context) | |
| Constructs a Part with an explicit Context reference and unique ID. | |
| virtual | ~Part ()=default |
| uint64_t | GetId () const |
| Returns the unique identifier for this Part. | |
| bool | operator== (const Part &other) const |
| Compares two Parts for equality by their unique IDs. | |
| std::shared_ptr< Context > | GetContext () const |
| Returns the Context this Part belongs to, or nullptr if unset. | |
| void | SetContext (std::shared_ptr< Context > ctx) |
| Sets the Context this Part belongs to. | |
Protected Member Functions | |
| virtual void | OnAdded (bool forced) |
| Called after this Part has been added to a PartList. | |
| virtual void | OnRemoved (bool forced) |
| Called after this Part has been removed from a PartList. | |
Friends | |
| template<typename , typename > | |
| class | PartList |
Base class for all identifiable objects in the component system.
Every Part is automatically assigned a unique, monotonically increasing ID at construction time. IDs are never reused during the lifetime of the process.
Every Part also stores a weak reference to the Context it belongs to. This reference is set when the Part is added to the component hierarchy and propagated to child components by ComponentList.
| Ship::Part::Part | ( | ) |
Constructs a Part and assigns it a unique ID.
|
explicit |
|
virtualdefault |
| std::shared_ptr< Context > Ship::Part::GetContext | ( | ) | const |
| uint64_t Ship::Part::GetId | ( | ) | const |
Returns the unique identifier for this Part.
|
protectedvirtual |
|
protectedvirtual |
| bool Ship::Part::operator== | ( | const Part & | other | ) | const |
Compares two Parts for equality by their unique IDs.
| other | The Part to compare against. |
| void Ship::Part::SetContext | ( | std::shared_ptr< Context > | ctx | ) |
|
friend |