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
246 // Constructors
247 AIBehavior_data() = default;
250};
251
252// --- Component Inventory Data ---
254{
255 std::vector<std::string> items; // List of item IDs in the inventory
256
257 // Constructors
258 Inventory_data() = default;
261};
262
263// --- Component Render Data --- Sprite, Animation, FX, GUI, etc.
265{
266 SDL_FRect srcRect = { 0, 0, 25, 25 }; // Source rectangle for texture atlas
267 Sprite* sprite = nullptr; // Pointer to the sprite/texture
268 Vector hotSpot; // Hotspot offset for rendering
269 SDL_Color color = { 255, 255, 255, 255 }; // Color (RGBA)
270 bool visible = true; // Is the entity visible
271
272 // Constructors
273 VisualSprite_data() = default;
279 {
280 if (sprite)
281 {
282 srcRect.w = static_cast<float>(sprite->w);
283 srcRect.h = static_cast<float>(sprite->h);
284 hotSpot.x = srcRect.w / 2.f;
285 hotSpot.y = srcRect.h / 2.f;
286 }
287 }
288};
289
290// --- Component visual Editor Data ---
292{
293 SDL_FRect srcRect = { 0, 0, 25, 25 }; // Source rectangle for texture atlas
294 Sprite* sprite = nullptr; // Pointer to the sprite/texture
295 Vector hotSpot; // Hotspot offset for rendering
296 SDL_Color color = { 255, 255, 255, 255 }; // Color (RGBA)
297 bool isSelected = false; // Is the entity selected in the editor?
298 bool isVisible = true; // Is the entity visible in the editor?
299
300 // Constructors
301 VisualEditor_data() = default;
307 {
308 if (sprite)
309 {
310 srcRect.w = static_cast<float>(sprite->w);
311 srcRect.h = static_cast<float>(sprite->h);
312 hotSpot.x = srcRect.w / 2.f;
313 hotSpot.y = srcRect.h / 2.f;
314 }
315 }
316};
317
318// --- Component Animation Data ---
320{
321 std::string animationID; // ID of the animation
322 int currentFrame = 0; // Current frame index
323 float frameDuration = 0.1f; // Duration of each frame in seconds
324 float elapsedTime = 0.0f; // Time elapsed since last frame change
325
326 // Constructors
327 Animation_data() = default;
330};
331
332// --- Component Visual Animation Data (for Animation System V2) ---
333// Forward declarations for animation system types
334namespace OlympeAnimation
335{
336 class AnimationGraph;
337 class AnimationBank;
338}
339
340// Forward declaration for AnimationSequence
341namespace Olympe { struct AnimationSequence; }
342
343/**
344 * @struct VisualAnimation_data
345 * @brief ECS component for animated sprites
346 */
348{
349 // Animation bank reference
350 std::string bankId; // Reference to animation bank
351 std::string currentAnimName; // Current animation name
352 std::string animGraphPath; // Optional path to FSM graph
353
354 // Frame tracking
355 int currentFrame = 0; // Current frame index
356 float frameTimer = 0.0f; // Accumulated time for current frame
357
358 // Playback control
359 float playbackSpeed = 1.0f; // Speed multiplier (1.0 = normal)
360 bool isPlaying = true; // Is animation playing?
361 bool isPaused = false; // Is animation paused?
362 bool loop = true; // Should animation loop?
363
364 // Visual transforms
365 bool flipX = false; // Flip horizontally
366 bool flipY = false; // Flip vertically
367
368 // Event tracking
369 bool animationJustFinished = false; // Flag set when animation completes (one frame only)
370 int loopCount = 0; // Number of times animation has looped
371
372 // Runtime pointer (resolved from AnimationManager)
374
375 // Runtime parameters for FSM transitions (NEW)
376 std::unordered_map<std::string, float> floatParams;
377 std::unordered_map<std::string, bool> boolParams;
378 std::unordered_map<std::string, int> intParams;
379
380 // Constructors
384};
385
386// --- Component FX Data --- Visual effects like particles, explosions, etc.
388{
389 std::string effectType; // Type of effect (e.g., "explosion", "smoke")
390 float duration = 1.0f; // Duration of the effect in seconds
391 float elapsedTime = 0.0f; // Time elapsed since effect started
392
393 // Constructors
394 FX_data() = default;
395 FX_data(const FX_data&) = default;
396 FX_data& operator=(const FX_data&) = default;
397};
398
399// --- Component Audio Data ---
401{
402 std::string soundEffectID; // ID of the sound effect to play
403 float volume = 1.0f; // Volume level (0.0 to 1.0)
404
405 // Constructors
406 AudioSource_data() = default;
409};
410
411// --- Component Controller Data ---
413{
414 static constexpr int MAX_BUTTONS = 16;
415
416 short controllerID = -1; // Index of the controller (-1 = keyboard)
417 bool isConnected = false; // Is the controller connected?
418
419 // Normalized axes (deadzone applied)
422 float leftTrigger = 0.f; // 0..1
423 float rightTrigger = 0.f; // 0..1
424
425 // Buttons
426 bool buttons[MAX_BUTTONS] = {false};
427
428 // Haptics (optional)
429 bool isVibrating = false;
430 float vibrateStrength = 0.f;
431
432 // Constructors
433 Controller_data() = default;
436};
437
438// --- Component PlayerConroller Data ---
440{
441 Vector Joydirection; // Joystick direction vector
442 bool isJumping = false; // Is the player jumping?
443 bool isShooting = false; // Is the player shooting?
444 bool isWalking = false; // Is the player walking?
445 bool isRunning = false; // Is the player running?
446 bool isInteracting = false; // Is the player interacting?
447 bool isUsingItem = false; // Is the player using an item?
448 bool isMenuOpen = false; // Is the game menu open?
449
450 // Constructors
454};
455
456// --- Component Player Binding Controller --- JoystickID, KeyboardID, etc.
458{
459 short playerIndex = 0; // Index of the player (e.g., Player 1, Player 2)
460 short controllerID = -1; // ID of the joystick/controller
461
462 // Constructors
466};
467
468// --- Component NPC Data ---
470{
471 std::string npcType; // Type of NPC (e.g., "vendor", "quest_giver")
472
473 // Constructors
474 NPC_data() = default;
475 NPC_data(const NPC_data&) = default;
476 NPC_data& operator=(const NPC_data&) = default;
477};
478
479// --- Component Input Mapping Data ---
481{
482 // Map action name -> scancode/button
483 std::unordered_map<std::string, SDL_Scancode> keyboardBindings;
484 std::unordered_map<std::string, int> gamepadBindings;
485 float deadzone = 0.15f;
486 float sensitivity = 1.0f;
487
488 // Helper to initialize default bindings
490 {
491 // Keyboard default bindings (WASD + Arrows)
493 keyboardBindings["down_alt"] = SDL_SCANCODE_S;
494 keyboardBindings["left_alt"] = SDL_SCANCODE_A;
495 keyboardBindings["right_alt"] = SDL_SCANCODE_D;
502 keyboardBindings["interact"] = SDL_SCANCODE_E;
504
505 // Gamepad default bindings
506 gamepadBindings["jump"] = 0; // A button
507 gamepadBindings["shoot"] = 1; // B button
508 gamepadBindings["interact"] = 2; // X button
509 gamepadBindings["menu"] = 7; // Start button
510 }
511
512 // Constructors
513 InputMapping_data() = default;
516};
517
518// --- Grid settings (singleton component) ---
520{
521 Ortho = 0,
522 Iso = 1,
523 HexAxial = 2
524};
525
527{
528 bool enabled = false; // Disabled by default - toggle with TAB key
530
531 // Ortho / Iso: taille cellule en unités "world"
532 Vector cellSize = Vector(32.f, 32.f, 0.f);
533
534 // Hex axial (pointy-top): rayon en unités "world"
535 float hexRadius = 16.f;
536
537 // Render
538 SDL_Color color = { 180, 180, 180, 255 };
539 int maxLines = 1200; // budget perf
540
541 // LOD: skip lines based on zoom to avoid visual clutter
542 float lodZoomThreshold = 0.5f; // Below this zoom, apply LOD
543 int lodSkipFactor = 10; // Draw 1 line every N when LOD active
544
545 // **NEW: Multi-layer overlay support**
546 bool showCollisionOverlay = false; // Hidden by default - toggle with C key
547 bool showNavigationOverlay = false; // Hidden by default - toggle with N key
548
549 // **NEW: Layer selection for visualization**
550 uint8_t activeCollisionLayer = 0; // Which collision layer to display (0-7)
551 uint8_t activeNavigationLayer = 0; // Which navigation layer to display (0-7)
552
553 // **Updated: Overlay colors per layer (increased alpha for better visibility)**
555 { 150, 50, 200, 150 }, // Ground: purple
556 { 50, 150, 255, 150 }, // Sky: cyan
557 { 100, 50, 50, 150 }, // Underground: dark red
558 { 255, 200, 50, 150 }, // Volume: orange
559 { 200, 200, 200, 150 }, // Custom1-4: gray variants
560 { 180, 180, 180, 150 },
561 { 160, 160, 160, 150 },
562 { 140, 140, 140, 150 }
563 };
564
566 { 50, 200, 100, 150 }, // Ground: green
567 { 100, 200, 255, 150 }, // Sky: light blue
568 { 200, 100, 50, 150 }, // Underground: brown
569 { 255, 255, 100, 150 }, // Volume: yellow
570 { 150, 255, 150, 150 }, // Custom1-4: green variants
571 { 120, 235, 120, 150 },
572 { 90, 215, 90, 150 },
573 { 60, 195, 60, 150 }
574 };
575
576 // Constructors
577 GridSettings_data() = default;
580};
581
582// Camera type enumeration
583enum class CameraType : uint8_t {
584 CameraType_2D = 0, // Standard 2D camera
585 CameraType_2_5D = 1, // 2.5D camera (follows on X axis only)
586 CameraType_Isometric = 2 // Isometric camera
587};
588
589// Camera control mode enumeration
591 Mode_Free, // Free camera movement
592 Mode_Follow, // Camera follows target strictly
593 Mode_FollowWithControl // Camera follows target + allows manual control
594};
595
596// --- Main Camera Component ---
597// Contains all core camera properties including position, zoom, rotation, and control settings
599{
600 short playerId = -1; // ID of the player who owns this camera
601 //EntityID playerEntityID = INVALID_ENTITY_ID; // EntityID of the player entity
602 CameraType type = CameraType::CameraType_2D; // Type of camera projection
603
604 // Position and offset
605 Vector position = { 0.f, 0.f, 0.f }; // World position of the camera
606 Vector baseOffset = { 0.f, 0.f, 0.f }; // Base offset for viewport centering
607 Vector controlOffset = { 0.f, 0.f, 0.f }; // Manual control offset from player
608
609 // Zoom management
610 float zoom = 1.0f; // Current zoom level
611 float targetZoom = 1.0f; // Target zoom level for smooth transitions
612 float zoomSpeed = 5.0f; // Speed of zoom interpolation
613 float minZoom = 0.1f; // Minimum allowed zoom
614 float maxZoom = 5.0f; // Maximum allowed zoom
615
616 // Discrete zoom levels
617 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 };
618 static constexpr size_t ZOOM_LEVEL_COUNT = sizeof(ZOOM_LEVELS) / sizeof(ZOOM_LEVELS[0]);
619 int currentZoomLevelIndex = 3; // Index 3 = 1.0 (default)
620
621 // Ensure ZOOM_LEVELS array has at least 4 entries (for default index 3)
622 static_assert(sizeof(ZOOM_LEVELS) / sizeof(ZOOM_LEVELS[0]) >= 4, "ZOOM_LEVELS must contain at least 4 entries for default index 3");
623
624 // Rotation management (in degrees) { "name": "speed", "type": "Float", "defaultValue": 100.0 },
625
626 float rotation = 0.0f; // Current rotation angle
627 float targetRotation = 0.0f; // Target rotation angle for smooth transitions
628 float rotationSpeed = 5.0f; // Speed of rotation interpolation
629
630 // Discrete rotation levels (15° increments)
631 static constexpr float ROTATION_STEP = 15.0f;
632 static constexpr int ROTATION_LEVELS = 24; // 360° / 15° = 24 levels
633 int currentRotationLevel = 0; // Index in [0, 23], where 0 = 0°
634
635 // Helper method to get rotation angle from level
636 static constexpr float GetRotationFromLevel(int level)
637 {
638 return (level * ROTATION_STEP); // level 0 = 0°, level 1 = 15°, etc.
639 }
640
641 // Control settings
643 SDL_FRect viewportRect = { 0.f, 0.f, 800.f, 600.f }; // Viewport rectangle
644
645 // Control parameters
646 float manualMoveSpeed = 200.0f; // Speed of manual camera movement (pixels/sec)
647 float zoomStep = 0.1f; // Zoom increment per input
648 float rotationStep = 15.0f; // Rotation increment per input (degrees)
649
650 bool isActive = true; // Is this camera active for rendering
651
652 // Constructors
653 Camera_data() = default;
654 Camera_data(const Camera_data&) = default;
656};
657
658// --- Camera Target Component ---
659// Handles target following for both ECS entities and legacy GameObjects
661{
662 EntityID targetEntityID = INVALID_ENTITY_ID; // ECS entity to follow
663
664 bool followTarget = false; // Enable/disable target following
665 float smoothFactor = 5.0f; // Smoothing factor for following (0-10, higher = smoother)
666 Vector followOffset = { 0.f, 0.f, 0.f }; // Additional offset when following target
667
668 bool allowManualControl = true; // Allow manual control while following
669 float manualControlDecay = 2.0f; // Speed at which manual offset decays back to target
670
671 // Constructors
672 CameraTarget_data() = default;
675};
676
677// --- Camera Effects Component ---
678// Visual effects such as camera shake
680{
681 bool isShaking = false; // Is camera shake active
682 float shakeIntensity = 0.0f; // Intensity of the shake effect
683 float shakeDuration = 0.0f; // Total duration of shake in seconds
684 float shakeTimeRemaining = 0.0f; // Time remaining for shake effect
685 Vector shakeOffset = { 0.f, 0.f, 0.f }; // Current shake offset applied to position
686
687 // Constructors
691};
692
693// --- Camera Bounds Component ---
694// Constrains camera movement to a specific area
696{
697 bool useBounds = false; // Enable/disable boundary constraints
698 SDL_FRect boundingBox = { 0.f, 0.f, 0.f, 0.f }; // World space bounding box
699 bool clampToViewport = true; // Clamp camera so viewport stays within bounds
700
701 // Constructors
702 CameraBounds_data() = default;
705};
706
707// --- Camera Input Binding Component ---
708// Configures input controls for the camera (keyboard or joystick)
710{
711 // Player/device identification
712 short playerId = -1; // Player ID (-1 = keyboard, >= 0 = joystick)
713 SDL_JoystickID joystickId = 0; // Joystick device ID
714 bool useKeyboard = false; // Use keyboard controls
715
716 // Keyboard bindings (using numpad scancodes - hardware-based, layout-independent)
721
722 // Diagonal movement keys
727
728 SDL_Scancode key_reset = SDL_SCANCODE_KP_5; // Reset camera controls
733
734 // Joystick bindings
735 int axis_horizontal = 2; // Right stick horizontal axis
736 int axis_vertical = 3; // Right stick vertical axis
737 int trigger_left = 4; // Left trigger for rotation
738 int trigger_right = 5; // Right trigger for rotation
739 int button_reset = 10; // Button to reset camera
740
741 // Input thresholds
742 float deadzone = 0.15f; // Deadzone for analog sticks
743 float triggerThreshold = 0.3f; // Threshold for trigger activation
744
745 // Current input state (updated each frame)
746 Vector inputDirection = { 0.f, 0.f, 0.f }; // Normalized input direction
747 float rotationInput = 0.0f; // Rotation input value (-1 to 1)
748 float zoomInput = 0.0f; // Zoom input value (-1 to 1)
749 bool resetRequested = false; // Reset button pressed this frame
750
751 // Previous trigger state for edge detection (discrete rotation)
752 bool prevLeftTriggerPressed = false; // Was left trigger pressed last frame
753 bool prevRightTriggerPressed = false; // Was right trigger pressed last frame
754
755 // Constructors
759};
760
761// --- Collision Zone Component ---
762// Represents a static collision area (e.g., from Tiled object layer)
764{
765 SDL_FRect bounds = { 0.f, 0.f, 100.f, 100.f }; // Collision rectangle
766 bool isStatic = true; // Is this a static collision zone
767
768 // Constructors
773};
774
775// --- Navigation Agent Component ---
776// Navigation agent component (lightweight, entity-specific data only)
778{
779 // Agent properties
780 float agentRadius = 16.0f; // Collision radius for pathfinding
781 float maxSpeed = 100.0f; // Max movement speed
782 float arrivalThreshold = 5.0f; // Distance to consider "arrived"
783
784 // Layer mask (which collision layers this agent can traverse)
785 uint8_t layerMask = 0x01; // Bit 0 = Ground layer by default
786
787 // Pathfinding state
788 std::vector<Vector> currentPath; // Cached path (world coordinates)
789 int currentWaypointIndex = 0; // Current target waypoint in path
791 bool hasPath = false;
792 bool needsRepath = false;
793
794 // Optional: steering behaviors
795 float steeringWeight = 1.0f;
796 bool avoidObstacles = true;
797
801};
802
803// Editor context for plugins
805{
806 bool isDirty = false;
807 float deltaTime = 0.0f;
808
809 // Constructors
810 EditorContext_st() = default;
813};
SDL_Texture Sprite
Definition DataManager.h:34
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:27
float x
Definition vector.h:27
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