Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
message.h
Go to the documentation of this file.
1#pragma once
2
3#include "system_consts.h"
4#include <string>
5#include <cstdint>
6
7// Message struct in the global namespace. ECS-first event architecture with domain routing.
8// Generic payload fields support input events and other event types without platform dependencies.
9struct Message
10{
11 EventType msg_type = EventType::Olympe_EventType_Any; // message identifier (transition: kept for compatibility)
12 EventDomain domain = EventDomain::Gameplay; // domain for routing to appropriate systems
13
14 uint64_t targetUid = 0; // target object UID for operations (create/destroy/add property)
15
16 // Generic integer / float payload fields. For input events these are used as:
17 // - deviceId : joystick instance id, keyboard id (-1), mouse id
18 // - controlId: button index or axis index or scancode
19 // - state : button pressed (1) / released (0) or other integer state
20 // - param1 : axis value normalized to [-1,1] or primary float payload
21 // - param2 : secondary float payload (e.g. mouse Y coordinate)
22 int deviceId = -1;
23 int controlId = -1;
24 int state = 0;
25 float param1 = 0.0f;
26 float param2 = 0.0f;
27
31 int _d_id = -1,
32 int _c_id = -1,
34 )
35 {
38 msg.domain = _domain;
39 msg.deviceId = _d_id;
40 msg.controlId = _c_id;
41 msg.targetUid = _t_uid;
42 return msg;
43 }
44};
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
static Message Create(EventType _ev_t, EventDomain _domain, int _d_id=-1, int _c_id=-1, uint64_t _t_uid=0)
Definition message.h:28
float param1
Definition message.h:25
int state
Definition message.h:24
int deviceId
Definition message.h:22
int controlId
Definition message.h:23
uint64_t targetUid
Definition message.h:14
EventType msg_type
Definition message.h:11
float param2
Definition message.h:26
EventDomain domain
Definition message.h:12
EventType
@ Olympe_EventType_Any
EventDomain