RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
Loading...
Searching...
No Matches
Components.h
Go to the documentation of this file.
1#pragma once
2// Components.h
3
4#include <vector>
5#include <string>
6#include <glm/glm.hpp>
7#include <GL/glew.h>
8#include "flecs.h"
9#include <shared_mutex>
10
11// Identifier Component
13{
14 uint64_t id; // Unique identifier for each entity
15};
16
17// Position Component
19{
20 float x;
21 float y;
22};
23
24// Size Component
25struct Size
26{
27 float width;
28 float height;
29};
30
31// Visibility Component
33{
35};
36
37// Moving Component
38struct Moving
39{
41};
42
43// Texture Component
45{
46 GLuint textureID;
47 std::string image_path;
48 glm::vec2 size;
49};
50
51// Zoom Component
52//struct Zoom {
53// float zoomLevel;
54//};
55
56// Panning Component
57struct Panning
58{
60};
61
62// Grid Component
63struct Grid
64{
65 glm::vec2 offset;
66 float cell_size;
67 bool is_hex;
69 bool visible;
70 float opacity;
71};
72
73// Board Component
74struct Board
75{
76 std::string board_name;
77};
78
80{
81 std::string ownerUniqueId; // authoritative owner (stable)
82 std::string ownerPeerUsername; // cosmetic cache for UI (last known)
83 bool allowAllPlayersMove = false;
84 bool locked = false;
85};
86
87// FogOfWar Component
89{
90};
91
92// GameTable Component
94{
95 std::string gameTableName;
96};
97
99{
100};
101
102// Notes Component
103struct Notes
104{
105 std::vector<flecs::entity> notes;
106};
107
109{
110 std::string uuid;
111 std::string title;
112 std::string markdown_text;
113 std::string author;
114 std::string creation_date;
115 std::string last_update;
116
117 bool open_editor = false;
118 bool selected = false;
119 bool shared = false;
120 bool saved_locally = false;
121 bool has_conflict = false;
122 std::string shared_from;
123};
124
125// Network Component
126//struct Network {
127// std::string external_ip;
128// std::string internal_ip;
129// unsigned short port;
130// std::string password;
131// std::vector<std::shared_ptr<std::string>> active_peers;
132// bool is_gamemaster;
133//};
134//
135//struct PeerInfo {
136// std::string id;
137// std::string username;
138// bool isAuthenticated = false;
139// bool isGameMaster = false;
140//};
std::string board_name
Definition Components.h:76
std::string gameTableName
Definition Components.h:95
bool snap_to_grid
Definition Components.h:68
glm::vec2 offset
Definition Components.h:65
float opacity
Definition Components.h:70
float cell_size
Definition Components.h:66
bool is_hex
Definition Components.h:67
bool visible
Definition Components.h:69
uint64_t id
Definition Components.h:14
std::string ownerPeerUsername
Definition Components.h:82
std::string ownerUniqueId
Definition Components.h:81
bool allowAllPlayersMove
Definition Components.h:83
bool isDragging
Definition Components.h:40
std::string creation_date
Definition Components.h:114
std::string last_update
Definition Components.h:115
std::string uuid
Definition Components.h:110
std::string shared_from
Definition Components.h:122
std::string markdown_text
Definition Components.h:112
std::string title
Definition Components.h:111
std::string author
Definition Components.h:113
std::vector< flecs::entity > notes
Definition Components.h:105
bool isPanning
Definition Components.h:59
float y
Definition Components.h:21
float x
Definition Components.h:20
float height
Definition Components.h:28
float width
Definition Components.h:27
glm::vec2 size
Definition Components.h:48
std::string image_path
Definition Components.h:47
bool isVisible
Definition Components.h:34