diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-21 17:44:03 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-23 11:42:23 -0500 |
| commit | fa7fc343a0e444da72938fad58d219cf52228976 (patch) | |
| tree | 24630be0c54f9768a13f32c5970558768e343543 /example/example.cpp | |
| parent | 6fa3b137c74536d2bab77f3309ca5b4c60953fe0 (diff) | |
plugin checkpoint - multiple plugins and collision callbacks
Diffstat (limited to 'example/example.cpp')
| -rw-r--r-- | example/example.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/example/example.cpp b/example/example.cpp new file mode 100644 index 0000000..b870806 --- /dev/null +++ b/example/example.cpp @@ -0,0 +1,27 @@ + +#include "example.hpp" + +#include "components.hpp" + +void OnEntityTypeCollision(const EntityHandle &lhs, const EntityHandle &rhs) { + fprintf(stdout, "[Example::OnEntityTypeCollision] Called\n"); +} + +void OnEntityCollision(const EntityHandle &lhs, const EntityHandle &rhs) { + fprintf(stdout, "[Example::OnEntityCollision] Called\n"); +} + +void OnInit() { + PkeArray_Add(&pkePluginCallbacks, PkeCallback { + .name = "OnEntTypeColl", + .func = reinterpret_cast<void *>(OnEntityTypeCollision), + }); + PkeArray_Add(&pkePluginCallbacks, PkeCallback { + .name = "OnEntColl", + .func = reinterpret_cast<void *>(OnEntityCollision), + }); +} + +PKEPluginInterface pkePluginInterface { + .OnInit = OnInit, +}; |
