Phase 2: Entity data model extensions for behavior system

- Add Behavior enum (IDLE..FLEE, 11 values) and Trigger enum (DONE,
  BLOCKED, TARGET) as runtime IntEnum classes (closes #297, closes #298)
- Add entity label system: labels property (frozenset), add_label(),
  remove_label(), has_label(), constructor kwarg (closes #296)
- Add cell_pos integer logical position decoupled from float draw_pos;
  grid_pos now aliases cell_pos; SpatialHash::updateCell() for cell-based
  bucket management; FOV/visibility uses cell_position (closes #295)
- Add step callback and default_behavior properties to Entity for
  grid.step() turn management (closes #299)
- Update updateVisibility, visible_entities, ColorLayer::updatePerspective
  to use cell_position instead of float position

BREAKING: grid_pos no longer derives from float x/y position. Use
cell_pos/grid_pos for logical position, draw_pos for render position.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
John McCardle 2026-03-15 22:05:06 -04:00
commit 2f1e472245
15 changed files with 886 additions and 34 deletions

View file

@ -16,6 +16,8 @@
#include "PyKey.h"
#include "PyMouseButton.h"
#include "PyInputState.h"
#include "PyBehavior.h"
#include "PyTrigger.h"
#include "PySound.h"
#include "PySoundBuffer.h"
#include "PyMusic.h"
@ -779,6 +781,18 @@ PyObject* PyInit_mcrfpy()
PyErr_Clear();
}
// Add Behavior enum class for entity behavior types (#297)
PyObject* behavior_class = PyBehavior::create_enum_class(m);
if (!behavior_class) {
PyErr_Clear();
}
// Add Trigger enum class for entity step callback triggers (#298)
PyObject* trigger_class = PyTrigger::create_enum_class(m);
if (!trigger_class) {
PyErr_Clear();
}
// Add automation submodule
PyObject* automation_module = McRFPy_Automation::init_automation_module();
if (automation_module != NULL) {