Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
ECS_Components.h
Go to the documentation of this file.
1/**
2 * @file ECS_Components.h
3 * @brief Core ECS component definitions
4 * @author Nicolas Chereau
5 * @date 2025
6 *
7 * This file contains all component data structures used in the
8 * Entity Component System architecture.
9 *
10 * Components purpose: Include all component definitions used in the ECS architecture.
11 */
12
13#pragma once
14
15#include "ECS_Entity.h"
16#include <string>
17#include <unordered_map>
18#include "vector.h"
19#include <SDL3/SDL.h>
20#include "DataManager.h"
21#include "SDL_rect.h"
22
23// NOTE: ComponentRegistry.h is NOT included here to avoid circular dependency.
24// AUTO_REGISTER_COMPONENT calls are in ECS_Components_Registration.cpp
25
26// ========================================================================
27// Entity Type Enumeration
28// ========================================================================
29
30/**
31 * @brief Entity type classification
32 *
33 * Used to categorize entities for gameplay and rendering purposes.
34 */
35enum class EntityType : int
36{
37 None = 0,
38 Player,
39 NPC,
40 Enemy,
41 Item,
43 Effect,
47 Trigger,
49 Static,
51};
52
53// ========================================================================
54// Render Layers (Z-Order) - Used for depth sorting
55// ========================================================================
56
57/**
58 * @brief Render layer enumeration for Z-ordering
59 *
60 * Defines rendering order with lower values rendered first (background)
61 * and higher values rendered last (foreground).
62 */
63enum class RenderLayer : int
64{
65 Background_Far = -2, // -2 * 10000 = -20000 (distant parallax backgrounds)
66 Background_Near = -1, // -1 * 10000 = -10000 (near backgrounds)
67 Ground = 0, // 0 * 10000 = 0 (floor tiles, terrain)
68 Objects = 1, // 1 * 10000 = 10000 (items, decorations, collectibles)
69 Characters = 2, // 2 * 10000 = 20000 (NPCs, players)
70 Flying = 3, // 3 * 10000 = 30000 (flying enemies, projectiles)
71 Effects = 4, // 4 * 10000 = 40000 (particles, VFX)
72 UI_Near = 5, // 5 * 10000 = 50000 (UI elements, HUD)
73 Foreground_Near = 10, // 10 * 10000 = 100000 (close foreground elements)
74 Foreground_Far = 20 // 20 * 10000 = 200000 (very close overlay)
75};
76
77/// Convert layer enum to z-coordinate value
78inline float LayerToZ(RenderLayer layer)
79{
80 return static_cast<float>(static_cast<int>(layer));
81}
82
83/// Convert z-coordinate to layer enum (rounds to nearest integer)
84/// Note: z-coordinates should exactly match RenderLayer integer values for proper layer mapping
85inline RenderLayer ZToLayer(float z)
86{
87 return static_cast<RenderLayer>(static_cast<int>(z + (z >= 0 ? 0.5f : -0.5f)));
88}
89
90// Component type definitions
91
92/**
93 * @brief Identity component for entity identification
94 *
95 * Stores basic entity identification information including name, tag,
96 * and type classification.
97 */
99{
100 /** @brief Entity name identifier */
101 std::string name = "Entity";
102
103 /** @brief Entity tag/category for grouping */
104 std::string tag = "Untagged";
105
106 /** @brief Entity type string (for backward compatibility) */
107 std::string type = "UnknownType";
108
109 /** @brief Entity type enum (for layer management) */
111
112 /** @brief Should the entity persist across levels? */
113 bool isPersistent = false;
114
115 /** @brief Default constructor */
116 Identity_data() = default;
117
118 /**
119 * @brief Construct with name, tag, and type
120 * @param n Entity name
121 * @param t Entity tag
122 * @param et Entity type string
123 */
124 Identity_data(std::string n, std::string t, std::string et)
125 : name(std::move(n)), tag(std::move(t)), type(std::move(et)), entityType(EntityType::None) {}
126
127 /** @brief Copy constructor */
128 Identity_data(const Identity_data&) = default;
129
130 /** @brief Copy assignment operator */
132};
133
134/**
135 * @brief Position component for spatial location
136 *
137 * Stores entity position in world space.
138 */
140{
141 /** @brief 2D/3D position vector */
143
144 /** @brief Default constructor */
145 Position_data() = default;
146
147 /**
148 * @brief Construct with position
149 * @param pos Initial position vector
150 */
152
153 /** @brief Copy constructor */
154 Position_data(const Position_data&) = default;
155
156 /** @brief Copy assignment operator */
158};
159
160/**
161 * @brief Bounding box component for collision detection
162 *
163 * Defines rectangular collision area for the entity.
164 */
165
166// --- Component BoundingBox Data ---
168{
169 /** @brief Collision rectangle */
170 SDL_FRect boundingBox = {0.f, 0.f, 25.f, 25.f};
171
172 /** @brief Default constructor */
173 BoundingBox_data() = default;
174
175 /**
176 * @brief Construct with bounding box
177 * @param rect SDL rectangle for collision bounds
178 */
180
181 /** @brief Copy constructor */
183
184 /** @brief Copy assignment operator */
186};
187
188// --- Component Detection Data ---
190{
191 float radius = 15.f; // Detection radius
192 bool triggered = false; // Is something detected?
193
194 // Constructors
195 TriggerZone_data() = default;
198};
199
200// --- Component Movement Data ---
202{
203 Vector direction; // Movement direction vector
204 Vector velocity; // Velocity vector
205
206 // Constructors
207 Movement_data() = default;
208 Movement_data(const Movement_data&) = default;
210};
211
212// --- Component Physics Data ---
214{
215 float mass = 1.0f; // Mass of the body
216 float speed = 150.0f; // Movement speed in pixels/second
217 float friction = 0.1f; // Friction coefficient
218 bool useGravity = true; // Is gravity applied?
219 bool rotation = false; // Is rotation allowed?
220
221 // Constructors
222 PhysicsBody_data() = default;
223 PhysicsBody_data(float m, float s) : mass(m), speed(s) {}
226};
227
228// --- Component Health Data ---
230{
231 int currentHealth = 100; // Current health points
232 int maxHealth = 100; // Maximum health points
233
234 // Constructors
235 Health_data() = default;
237 Health_data(const Health_data&) = default;
239};
240
241// --- Component AI Data ---
243{
244 std::string behaviorType = "idle"; // Type of AI behavior (e.g., "patrol", "chase")
245 std::string behaviorTreePath = ""; // Path to behavior tree JSON file (*.bt.json)
246 bool isActive = false; // Runtime state: is the behavior tree active
247 int currentNodeId = -1; // Runtime state: current executing node ID
248
249 // Constructors
250 AIBehavior_data() = default;
253};
254
255// --- Component Inventory Data ---
257{
258 std::vector<std::string> items; // List of item IDs in the inventory
259
260 // Constructors
261 Inventory_data() = default;
264};
265
266// --- Component Render Data --- Sprite, Animation, FX, GUI, etc.
268{
269 SDL_FRect srcRect = { 0, 0, 25, 25 }; // Source rectangle for texture atlas
270 Sprite* sprite = nullptr; // Pointer to the sprite/texture
271 Vector hotSpot; // Hotspot offset for rendering
272 SDL_Color color = { 255, 255, 255, 255 }; // Color (RGBA)
273 bool visible = true; // Is the entity visible
274
275 // Constructors
276 VisualSprite_data() = default;
282 {
283 if (sprite)
284 {
285 srcRect.w = static_cast<float>(sprite->w);
286 srcRect.h = static_cast<float>(sprite->h);
287 hotSpot.x = srcRect.w / 2.f;
288 hotSpot.y = srcRect.h / 2.f;
289 }
290 }
291};
292
293// --- Component visual Editor Data ---
295{
296 SDL_FRect srcRect = { 0, 0, 25, 25 }; // Source rectangle for texture atlas
297 Sprite* sprite = nullptr; // Pointer to the sprite/texture
298 Vector hotSpot; // Hotspot offset for rendering
299 SDL_Color color = { 255, 255, 255, 255 }; // Color (RGBA)
300 bool isSelected = false; // Is the entity selected in the editor?
301 bool isVisible = true; // Is the entity visible in the editor?
302
303 // Constructors
304 VisualEditor_data() = default;
310 {
311 if (sprite)
312 {
313 srcRect.w = static_cast<float>(sprite->w);
314 srcRect.h = static_cast<float>(sprite->h);
315 hotSpot.x = srcRect.w / 2.f;
316 hotSpot.y = srcRect.h / 2.f;
317 }
318 }
319};
320
321// --- Component Animation Data ---
323{
324 std::string animationID; // ID of the animation
325 int currentFrame = 0; // Current frame index
326 float frameDuration = 0.1f; // Duration of each frame in seconds
327 float elapsedTime = 0.0f; // Time elapsed since last frame change
328
329 // Constructors
330 Animation_data() = default;
333};
334
335// --- Component Visual Animation Data (for Animation System V2) ---
336// Forward declarations for animation system types
337namespace OlympeAnimation
338{
339 class AnimationGraph;
340 class AnimationBank;
341}
342
343// Forward declaration for AnimationSequence
344namespace Olympe { struct AnimationSequence; }
345
346/**
347 * @struct VisualAnimation_data
348 * @brief ECS component for animated sprites
349 */
351{
352 // Animation bank reference
353 std::string bankId; // Reference to animation bank
354 std::string currentAnimName; // Current animation name
355 std::string animGraphPath; // Optional path to FSM graph
356
357 // Frame tracking
358 int currentFrame = 0; // Current frame index
359 float frameTimer = 0.0f; // Accumulated time for current frame
360
361 // Playback control
362 float playbackSpeed = 1.0f; // Speed multiplier (1.0 = normal)
363 bool isPlaying = true; // Is animation playing?
364 bool isPaused = false; // Is animation paused?
365 bool loop = true; // Should animation loop?
366
367 // Visual transforms
368 bool flipX = false; // Flip horizontally
369 bool flipY = false; // Flip vertically
370
371 // Event tracking
372 bool animationJustFinished = false; // Flag set when animation completes (one frame only)
373 int loopCount = 0; // Number of times animation has looped
374
375 // Runtime pointer (resolved from AnimationManager)
377
378 // Runtime parameters for FSM transitions (NEW)
379 std::unordered_map<std::string, float> floatParams;
380 std::unordered_map<std::string, bool> boolParams;
381 std::unordered_map<std::string, int> intParams;
382
383 // Constructors
387};
388
389// --- Component FX Data --- Visual effects like particles, explosions, etc.
391{
392 std::string effectType; // Type of effect (e.g., "explosion", "smoke")
393 float duration = 1.0f; // Duration of the effect in seconds
394 float elapsedTime = 0.0f; // Time elapsed since effect started
395
396 // Constructors
397 FX_data() = default;
398 FX_data(const FX_data&) = default;
399 FX_data& operator=(const FX_data&) = default;
400};
401
402// --- Component Audio Data ---
404{
405 std::string soundEffectID; // ID of the sound effect to play
406 float volume = 1.0f; // Volume level (0.0 to 1.0)
407
408 // Constructors
409 AudioSource_data() = default;
412};
413
414// --- Component Controller Data ---
416{
417 static constexpr int MAX_BUTTONS = 16;
418
419 short controllerID = -1; // Index of the controller (-1 = keyboard)
420 bool isConnected = false; // Is the controller connected?
421
422 // Normalized axes (deadzone applied)
425 float leftTrigger = 0.f; // 0..1
426 float rightTrigger = 0.f; // 0..1
427
428 // Buttons
429 bool buttons[MAX_BUTTONS] = {false};
430
431 // Haptics (optional)
432 bool isVibrating = false;
433 float vibrateStrength = 0.f;
434
435 // Constructors
436 Controller_data() = default;
439};
440
441// --- Component PlayerConroller Data ---
443{
444 Vector Joydirection; // Joystick direction vector
445 bool isJumping = false; // Is the player jumping?
446 bool isShooting = false; // Is the player shooting?
447 bool isWalking = false; // Is the player walking?
448 bool isRunning = false; // Is the player running?
449 bool isInteracting = false; // Is the player interacting?
450 bool isUsingItem = false; // Is the player using an item?
451 bool isMenuOpen = false; // Is the game menu open?
452
453 // Constructors
457};
458
459// --- Component Player Binding Controller --- JoystickID, KeyboardID, etc.
461{
462 short playerIndex = 0; // Index of the player (e.g., Player 1, Player 2)
463 short controllerID = -1; // ID of the joystick/controller
464
465 // Constructors
469};
470
471// --- Component NPC Data ---
473{
474 std::string npcType; // Type of NPC (e.g., "vendor", "quest_giver")
475
476 // Constructors
477 NPC_data() = default;
478 NPC_data(const NPC_data&) = default;
479 NPC_data& operator=(const NPC_data&) = default;
480};
481
482// --- Component Input Mapping Data ---
484{
485 // Map action name -> scancode/button
486 std::unordered_map<std::string, SDL_Scancode> keyboardBindings;
487 std::unordered_map<std::string, int> gamepadBindings;
488 float deadzone = 0.15f;
489 float sensitivity = 1.0f;
490
491 // Helper to initialize default bindings
493 {
494 // Keyboard default bindings (WASD + Arrows)
496 keyboardBindings["down_alt"] = SDL_SCANCODE_S;
497 keyboardBindings["left_alt"] = SDL_SCANCODE_A;
498 keyboardBindings["right_alt"] = SDL_SCANCODE_D;
505 keyboardBindings["interact"] = SDL_SCANCODE_E;
507
508 // Gamepad default bindings
509 gamepadBindings["jump"] = 0; // A button
510 gamepadBindings["shoot"] = 1; // B button
511 gamepadBindings["interact"] = 2; // X button
512 gamepadBindings["menu"] = 7; // Start button
513 }
514
515 // Constructors
516 InputMapping_data() = default;
519};
520
521// --- Grid settings (singleton component) ---
523{
524 Ortho = 0,
525 Iso = 1,
526 HexAxial = 2
527};
528
530{
531 bool enabled = false; // Disabled by default - toggle with TAB key
533
534 // Ortho / Iso: taille cellule en unités "world"
535 Vector cellSize = Vector(32.f, 32.f, 0.f);
536
537 // Hex axial (pointy-top): rayon en unités "world"
538 float hexRadius = 16.f;
539
540 // Render
541 SDL_Color color = { 180, 180, 180, 255 };
542 int maxLines = 1200; // budget perf
543
544 // LOD: skip lines based on zoom to avoid visual clutter
545 float lodZoomThreshold = 0.5f; // Below this zoom, apply LOD
546 int lodSkipFactor = 10; // Draw 1 line every N when LOD active
547
548 // **NEW: Multi-layer overlay support**
549 bool showCollisionOverlay = false; // Hidden by default - toggle with C key
550 bool showNavigationOverlay = false; // Hidden by default - toggle with N key
551
552 // **NEW: Layer selection for visualization**
553 uint8_t activeCollisionLayer = 0; // Which collision layer to display (0-7)
554 uint8_t activeNavigationLayer = 0; // Which navigation layer to display (0-7)
555
556 // **Updated: Overlay colors per layer (increased alpha for better visibility)**
558 { 150, 50, 200, 150 }, // Ground: purple
559 { 50, 150, 255, 150 }, // Sky: cyan
560 { 100, 50, 50, 150 }, // Underground: dark red
561 { 255, 200, 50, 150 }, // Volume: orange
562 { 200, 200, 200, 150 }, // Custom1-4: gray variants
563 { 180, 180, 180, 150 },
564 { 160, 160, 160, 150 },
565 { 140, 140, 140, 150 }
566 };
567
569 { 50, 200, 100, 150 }, // Ground: green
570 { 100, 200, 255, 150 }, // Sky: light blue
571 { 200, 100, 50, 150 }, // Underground: brown
572 { 255, 255, 100, 150 }, // Volume: yellow
573 { 150, 255, 150, 150 }, // Custom1-4: green variants
574 { 120, 235, 120, 150 },
575 { 90, 215, 90, 150 },
576 { 60, 195, 60, 150 }
577 };
578
579 // Constructors
580 GridSettings_data() = default;
583};
584
585// Camera type enumeration
586enum class CameraType : uint8_t {
587 CameraType_2D = 0, // Standard 2D camera
588 CameraType_2_5D = 1, // 2.5D camera (follows on X axis only)
589 CameraType_Isometric = 2 // Isometric camera
590};
591
592// Camera control mode enumeration
594 Mode_Free, // Free camera movement
595 Mode_Follow, // Camera follows target strictly
596 Mode_FollowWithControl // Camera follows target + allows manual control
597};
598
599// --- Main Camera Component ---
600// Contains all core camera properties including position, zoom, rotation, and control settings
602{
603 short playerId = -1; // ID of the player who owns this camera
604 //EntityID playerEntityID = INVALID_ENTITY_ID; // EntityID of the player entity
605 CameraType type = CameraType::CameraType_2D; // Type of camera projection
606
607 // Position and offset
608 Vector position = { 0.f, 0.f, 0.f }; // World position of the camera
609 Vector baseOffset = { 0.f, 0.f, 0.f }; // Base offset for viewport centering
610 Vector controlOffset = { 0.f, 0.f, 0.f }; // Manual control offset from player
611
612 // Zoom management
613 float zoom = 1.0f; // Current zoom level
614 float targetZoom = 1.0f; // Target zoom level for smooth transitions
615 float zoomSpeed = 5.0f; // Speed of zoom interpolation
616 float minZoom = 0.1f; // Minimum allowed zoom
617 float maxZoom = 5.0f; // Maximum allowed zoom
618
619 // Discrete zoom levels
620 static constexpr float ZOOM_LEVELS[] = { 0.0125f, 0.025f, 0.05f, 0.1f, 0.15f, 0.25f, 0.5f, 0.75f, 1.0f, 1.25f, 1.5f, 2.0f, 2.5f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f };
621 static constexpr size_t ZOOM_LEVEL_COUNT = sizeof(ZOOM_LEVELS) / sizeof(ZOOM_LEVELS[0]);
622 int currentZoomLevelIndex = 3; // Index 3 = 1.0 (default)
623
624 // Ensure ZOOM_LEVELS array has at least 4 entries (for default index 3)
625 static_assert(sizeof(ZOOM_LEVELS) / sizeof(ZOOM_LEVELS[0]) >= 4, "ZOOM_LEVELS must contain at least 4 entries for default index 3");
626
627 // Rotation management (in degrees) { "name": "speed", "type": "Float", "defaultValue": 100.0 },
628
629 float rotation = 0.0f; // Current rotation angle
630 float targetRotation = 0.0f; // Target rotation angle for smooth transitions
631 float rotationSpeed = 5.0f; // Speed of rotation interpolation
632
633 // Discrete rotation levels (15° increments)
634 static constexpr float ROTATION_STEP = 15.0f;
635 static constexpr int ROTATION_LEVELS = 24; // 360° / 15° = 24 levels
636 int currentRotationLevel = 0; // Index in [0, 23], where 0 = 0°
637
638 // Helper method to get rotation angle from level
639 static constexpr float GetRotationFromLevel(int level)
640 {
641 return (level * ROTATION_STEP); // level 0 = 0°, level 1 = 15°, etc.
642 }
643
644 // Control settings
646 SDL_FRect viewportRect = { 0.f, 0.f, 800.f, 600.f }; // Viewport rectangle
647
648 // Control parameters
649 float manualMoveSpeed = 200.0f; // Speed of manual camera movement (pixels/sec)
650 float zoomStep = 0.1f; // Zoom increment per input
651 float rotationStep = 15.0f; // Rotation increment per input (degrees)
652
653 bool isActive = true; // Is this camera active for rendering
654
655 // Constructors
656 Camera_data() = default;
657 Camera_data(const Camera_data&) = default;
659};
660
661// --- Camera Target Component ---
662// Handles target following for both ECS entities and legacy GameObjects
664{
665 EntityID targetEntityID = INVALID_ENTITY_ID; // ECS entity to follow
666
667 bool followTarget = false; // Enable/disable target following
668 float smoothFactor = 5.0f; // Smoothing factor for following (0-10, higher = smoother)
669 Vector followOffset = { 0.f, 0.f, 0.f }; // Additional offset when following target
670
671 bool allowManualControl = true; // Allow manual control while following
672 float manualControlDecay = 2.0f; // Speed at which manual offset decays back to target
673
674 // Constructors
675 CameraTarget_data() = default;
678};
679
680// --- Camera Effects Component ---
681// Visual effects such as camera shake
683{
684 bool isShaking = false; // Is camera shake active
685 float shakeIntensity = 0.0f; // Intensity of the shake effect
686 float shakeDuration = 0.0f; // Total duration of shake in seconds
687 float shakeTimeRemaining = 0.0f; // Time remaining for shake effect
688 Vector shakeOffset = { 0.f, 0.f, 0.f }; // Current shake offset applied to position
689
690 // Constructors
694};
695
696// --- Camera Bounds Component ---
697// Constrains camera movement to a specific area
699{
700 bool useBounds = false; // Enable/disable boundary constraints
701 SDL_FRect boundingBox = { 0.f, 0.f, 0.f, 0.f }; // World space bounding box
702 bool clampToViewport = true; // Clamp camera so viewport stays within bounds
703
704 // Constructors
705 CameraBounds_data() = default;
708};
709
710// --- Camera Input Binding Component ---
711// Configures input controls for the camera (keyboard or joystick)
713{
714 // Player/device identification
715 short playerId = -1; // Player ID (-1 = keyboard, >= 0 = joystick)
716 SDL_JoystickID joystickId = 0; // Joystick device ID
717 bool useKeyboard = false; // Use keyboard controls
718
719 // Keyboard bindings (using numpad scancodes - hardware-based, layout-independent)
724
725 // Diagonal movement keys
730
731 SDL_Scancode key_reset = SDL_SCANCODE_KP_5; // Reset camera controls
736
737 // Joystick bindings
738 int axis_horizontal = 2; // Right stick horizontal axis
739 int axis_vertical = 3; // Right stick vertical axis
740 int trigger_left = 4; // Left trigger for rotation
741 int trigger_right = 5; // Right trigger for rotation
742 int button_reset = 10; // Button to reset camera
743
744 // Input thresholds
745 float deadzone = 0.15f; // Deadzone for analog sticks
746 float triggerThreshold = 0.3f; // Threshold for trigger activation
747
748 // Current input state (updated each frame)
749 Vector inputDirection = { 0.f, 0.f, 0.f }; // Normalized input direction
750 float rotationInput = 0.0f; // Rotation input value (-1 to 1)
751 float zoomInput = 0.0f; // Zoom input value (-1 to 1)
752 bool resetRequested = false; // Reset button pressed this frame
753
754 // Previous trigger state for edge detection (discrete rotation)
755 bool prevLeftTriggerPressed = false; // Was left trigger pressed last frame
756 bool prevRightTriggerPressed = false; // Was right trigger pressed last frame
757
758 // Constructors
762};
763
764// --- Collision Zone Component ---
765// Represents a static collision area (e.g., from Tiled object layer)
767{
768 SDL_FRect bounds = { 0.f, 0.f, 100.f, 100.f }; // Collision rectangle
769 bool isStatic = true; // Is this a static collision zone
770
771 // Constructors
776};
777
778// --- Navigation Agent Component ---
779// Navigation agent component (lightweight, entity-specific data only)
781{
782 // Agent properties
783 float agentRadius = 16.0f; // Collision radius for pathfinding
784 float maxSpeed = 100.0f; // Max movement speed
785 float arrivalThreshold = 5.0f; // Distance to consider "arrived"
786
787 // Layer mask (which collision layers this agent can traverse)
788 uint8_t layerMask = 0x01; // Bit 0 = Ground layer by default
789
790 // Pathfinding state
791 std::vector<Vector> currentPath; // Cached path (world coordinates)
792 int currentWaypointIndex = 0; // Current target waypoint in path
794 bool hasPath = false;
795 bool needsRepath = false;
796
797 // Optional: steering behaviors
798 float steeringWeight = 1.0f;
799 bool avoidObstacles = true;
800
804};
805
806// Editor context for plugins
808{
809 bool isDirty = false;
810 float deltaTime = 0.0f;
811
812 // Constructors
813 EditorContext_st() = default;
816};
SDL_Texture Sprite
Definition DataManager.h:38
GridProjection
CameraControlMode
float LayerToZ(RenderLayer layer)
Convert layer enum to z-coordinate value.
RenderLayer ZToLayer(float z)
Convert z-coordinate to layer enum (rounds to nearest integer) Note: z-coordinates should exactly mat...
CameraType
@ CameraType_Isometric
RenderLayer
Render layer enumeration for Z-ordering.
EntityType
Entity type classification.
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
std::uint64_t EntityID
Definition ECS_Entity.h:21
const EntityID INVALID_ENTITY_ID
Definition ECS_Entity.h:23
float y
Definition vector.h:25
float x
Definition vector.h:25
< Provides AssetID and INVALID_ASSET_ID
std::string behaviorTreePath
AIBehavior_data & operator=(const AIBehavior_data &)=default
AIBehavior_data(const AIBehavior_data &)=default
AIBehavior_data()=default
std::string behaviorType
Animation_data(const Animation_data &)=default
Animation_data()=default
std::string animationID
Animation_data & operator=(const Animation_data &)=default
std::string soundEffectID
AudioSource_data()=default
AudioSource_data(const AudioSource_data &)=default
AudioSource_data & operator=(const AudioSource_data &)=default
Bounding box component for collision detection.
BoundingBox_data & operator=(const BoundingBox_data &)=default
Copy assignment operator.
BoundingBox_data()=default
Default constructor.
BoundingBox_data(SDL_FRect rect)
Construct with bounding box.
SDL_FRect boundingBox
Collision rectangle.
BoundingBox_data(const BoundingBox_data &)=default
Copy constructor.
CameraBounds_data & operator=(const CameraBounds_data &)=default
CameraBounds_data(const CameraBounds_data &)=default
CameraBounds_data()=default
CameraEffects_data()=default
CameraEffects_data & operator=(const CameraEffects_data &)=default
CameraEffects_data(const CameraEffects_data &)=default
CameraInputBinding_data(const CameraInputBinding_data &)=default
CameraInputBinding_data()=default
CameraInputBinding_data & operator=(const CameraInputBinding_data &)=default
CameraTarget_data & operator=(const CameraTarget_data &)=default
CameraTarget_data()=default
CameraTarget_data(const CameraTarget_data &)=default
static constexpr int ROTATION_LEVELS
SDL_FRect viewportRect
static constexpr float ZOOM_LEVELS[]
CameraType type
static constexpr float ROTATION_STEP
CameraControlMode controlMode
Camera_data & operator=(const Camera_data &)=default
Vector controlOffset
float manualMoveSpeed
Camera_data()=default
int currentZoomLevelIndex
static constexpr float GetRotationFromLevel(int level)
Camera_data(const Camera_data &)=default
static constexpr size_t ZOOM_LEVEL_COUNT
CollisionZone_data & operator=(const CollisionZone_data &)=default
CollisionZone_data(SDL_FRect rect, bool isStatic_)
CollisionZone_data()=default
CollisionZone_data(const CollisionZone_data &)=default
bool buttons[MAX_BUTTONS]
static constexpr int MAX_BUTTONS
Controller_data(const Controller_data &)=default
Controller_data & operator=(const Controller_data &)=default
Controller_data()=default
EditorContext_st(const EditorContext_st &)=default
EditorContext_st & operator=(const EditorContext_st &)=default
EditorContext_st()=default
FX_data(const FX_data &)=default
FX_data()=default
std::string effectType
float elapsedTime
FX_data & operator=(const FX_data &)=default
float duration
GridProjection projection
GridSettings_data()=default
GridSettings_data(const GridSettings_data &)=default
uint8_t activeNavigationLayer
SDL_Color collisionColors[8]
SDL_Color navigationColors[8]
GridSettings_data & operator=(const GridSettings_data &)=default
Health_data(int current, int max)
Health_data & operator=(const Health_data &)=default
Health_data()=default
Health_data(const Health_data &)=default
Identity component for entity identification.
EntityType entityType
Entity type enum (for layer management)
Identity_data(std::string n, std::string t, std::string et)
Construct with name, tag, and type.
Identity_data(const Identity_data &)=default
Copy constructor.
std::string name
Entity name identifier.
Identity_data & operator=(const Identity_data &)=default
Copy assignment operator.
Identity_data()=default
Default constructor.
std::string type
Entity type string (for backward compatibility)
bool isPersistent
Should the entity persist across levels?
std::string tag
Entity tag/category for grouping.
std::unordered_map< std::string, SDL_Scancode > keyboardBindings
InputMapping_data()=default
InputMapping_data(const InputMapping_data &)=default
InputMapping_data & operator=(const InputMapping_data &)=default
std::unordered_map< std::string, int > gamepadBindings
Inventory_data(const Inventory_data &)=default
std::vector< std::string > items
Inventory_data & operator=(const Inventory_data &)=default
Inventory_data()=default
Movement_data & operator=(const Movement_data &)=default
Movement_data(const Movement_data &)=default
Movement_data()=default
std::string npcType
NPC_data(const NPC_data &)=default
NPC_data & operator=(const NPC_data &)=default
NPC_data()=default
NavigationAgent_data()=default
NavigationAgent_data & operator=(const NavigationAgent_data &)=default
std::vector< Vector > currentPath
NavigationAgent_data(const NavigationAgent_data &)=default
Defines a complete animation sequence.
PhysicsBody_data(float m, float s)
PhysicsBody_data(const PhysicsBody_data &)=default
PhysicsBody_data()=default
PhysicsBody_data & operator=(const PhysicsBody_data &)=default
PlayerBinding_data()=default
PlayerBinding_data & operator=(const PlayerBinding_data &)=default
PlayerBinding_data(const PlayerBinding_data &)=default
PlayerController_data(const PlayerController_data &)=default
PlayerController_data & operator=(const PlayerController_data &)=default
PlayerController_data()=default
Position component for spatial location.
Vector position
2D/3D position vector
Position_data(Vector pos)
Construct with position.
Position_data()=default
Default constructor.
Position_data & operator=(const Position_data &)=default
Copy assignment operator.
Position_data(const Position_data &)=default
Copy constructor.
TriggerZone_data & operator=(const TriggerZone_data &)=default
TriggerZone_data()=default
TriggerZone_data(const TriggerZone_data &)=default
ECS component for animated sprites.
VisualAnimation_data & operator=(const VisualAnimation_data &)=default
const Olympe::AnimationSequence * currentSequence
VisualAnimation_data(const VisualAnimation_data &)=default
std::unordered_map< std::string, bool > boolParams
std::unordered_map< std::string, float > floatParams
std::unordered_map< std::string, int > intParams
std::string currentAnimName
VisualAnimation_data()=default
VisualEditor_data(SDL_FRect rect, Sprite *spr, Vector hotspot)
VisualEditor_data & operator=(const VisualEditor_data &)=default
VisualEditor_data(const VisualEditor_data &)=default
VisualEditor_data()=default
VisualSprite_data & operator=(const VisualSprite_data &)=default
VisualSprite_data(SDL_FRect rect, Sprite *spr, Vector hotspot)
VisualSprite_data(const VisualSprite_data &)=default
VisualSprite_data()=default