- 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>
21 lines
661 B
C++
21 lines
661 B
C++
#pragma once
|
|
#include "Common.h"
|
|
#include "Python.h"
|
|
|
|
// Module-level Behavior enum class (created at runtime using Python's IntEnum)
|
|
// Stored as a module attribute: mcrfpy.Behavior
|
|
//
|
|
// Values represent entity behavior types for grid.step() turn management.
|
|
|
|
class PyBehavior {
|
|
public:
|
|
// Create the Behavior enum class and add to module
|
|
// Returns the enum class (new reference), or NULL on error
|
|
static PyObject* create_enum_class(PyObject* module);
|
|
|
|
// Cached reference to the Behavior enum class for fast type checking
|
|
static PyObject* behavior_enum_class;
|
|
|
|
// Number of behavior types
|
|
static const int NUM_BEHAVIORS = 11;
|
|
};
|