|
Entity Generator 1.1.0
Composable, deterministic entity generation for C++23
|
Observer interface for hooking into generation lifecycle events. More...
#include <entitygen.hpp>
Public Member Functions | |
| virtual | ~generation_observer ()=default |
| Virtual destructor. | |
Entity Lifecycle | |
| virtual void | on_before_generate () |
| Called before an entity is generated. | |
| virtual void | on_after_generate (const entity &e) |
| Called after an entity is successfully generated. | |
Component Generation | |
| virtual void | on_before_component (const std::wstring &key) |
| Called before a component is generated. | |
| virtual void | on_after_component (const std::wstring &key, const std::any &value) |
| Called after a component is successfully generated. | |
Component Skip | |
| virtual void | on_skip (const std::wstring &key) |
| Called when a component is skipped (weight roll or conditional exclusion). | |
Component Validation | |
| virtual void | on_before_retry (const std::wstring &key, std::size_t attempt) |
| Called before a component validation retry. | |
| virtual void | on_after_retry (const std::wstring &key, std::size_t attempt, const std::any &value) |
| Called after a component validation retry. | |
| virtual void | on_component_fail (const std::wstring &key) |
| Called when component validation is exhausted (precedes exception). | |
Entity Validation | |
| virtual void | on_before_entity_retry (std::size_t attempt) |
| Called before an entity validation retry. | |
| virtual void | on_after_entity_retry (std::size_t attempt) |
| Called after an entity validation retry. | |
| virtual void | on_entity_fail () |
| Called when entity validation is exhausted (precedes exception). | |
Component Registration | |
| virtual void | on_before_add (const std::wstring &key) |
| Called before a component is registered. | |
| virtual void | on_after_add (const std::wstring &key) |
| Called after a component is registered. | |
| virtual void | on_before_remove (const std::wstring &key) |
| Called before a component is removed. | |
| virtual void | on_after_remove (const std::wstring &key) |
| Called after a component is removed. | |
Observer interface for hooking into generation lifecycle events.
Override only the methods you care about; all default to no-ops. Multiple observers can be attached to a generator via eg::add_observer().
Definition at line 583 of file entitygen.hpp.
|
inlinevirtual |
Called after a component is registered.
| key | The component key that was added. |
Definition at line 663 of file entitygen.hpp.
|
inlinevirtual |
Called after a component is successfully generated.
| key | The component key. |
| value | The generated value. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 608 of file entitygen.hpp.
|
inlinevirtual |
Called after an entity validation retry.
| attempt | The entity retry attempt number. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 649 of file entitygen.hpp.
|
inlinevirtual |
Called after an entity is successfully generated.
| e | The generated entity. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 596 of file entitygen.hpp.
|
inlinevirtual |
Called after a component is removed.
| key | The component key that was removed. |
Definition at line 670 of file entitygen.hpp.
|
inlinevirtual |
Called after a component validation retry.
| key | The component key. |
| attempt | The retry attempt number. |
| value | The newly generated value. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 632 of file entitygen.hpp.
|
inlinevirtual |
Called before a component is registered.
| key | The component key being added. |
Definition at line 660 of file entitygen.hpp.
|
inlinevirtual |
Called before a component is generated.
| key | The component key about to be generated. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 604 of file entitygen.hpp.
|
inlinevirtual |
Called before an entity validation retry.
| attempt | The entity retry attempt number (1-based). |
Definition at line 646 of file entitygen.hpp.
|
inlinevirtual |
Called before an entity is generated.
Reimplemented in dasmig::ext::stats_observer.
Definition at line 593 of file entitygen.hpp.
|
inlinevirtual |
Called before a component is removed.
| key | The component key being removed. |
Definition at line 667 of file entitygen.hpp.
|
inlinevirtual |
Called before a component validation retry.
| key | The component key being retried. |
| attempt | The retry attempt number (1-based). |
Definition at line 626 of file entitygen.hpp.
|
inlinevirtual |
Called when component validation is exhausted (precedes exception).
| key | The failed component key. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 638 of file entitygen.hpp.
|
inlinevirtual |
Called when entity validation is exhausted (precedes exception).
Reimplemented in dasmig::ext::stats_observer.
Definition at line 652 of file entitygen.hpp.
|
inlinevirtual |
Called when a component is skipped (weight roll or conditional exclusion).
| key | The skipped component key. |
Reimplemented in dasmig::ext::stats_observer.
Definition at line 617 of file entitygen.hpp.