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
12
struct
Identifier
13
{
14
uint64_t
id
;
// Unique identifier for each entity
15
};
16
17
// Position Component
18
struct
Position
19
{
20
float
x
;
21
float
y
;
22
};
23
24
// Size Component
25
struct
Size
26
{
27
float
width
;
28
float
height
;
29
};
30
31
// Visibility Component
32
struct
Visibility
33
{
34
bool
isVisible
;
35
};
36
37
// Moving Component
38
struct
Moving
39
{
40
bool
isDragging
;
41
};
42
43
// Texture Component
44
struct
TextureComponent
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
57
struct
Panning
58
{
59
bool
isPanning
;
60
};
61
62
// Grid Component
63
struct
Grid
64
{
65
glm::vec2
offset
;
66
float
cell_size
;
67
bool
is_hex
;
68
bool
snap_to_grid
;
69
bool
visible
;
70
float
opacity
;
71
};
72
73
// Board Component
74
struct
Board
75
{
76
std::string
board_name
;
77
};
78
79
struct
MarkerComponent
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
88
struct
FogOfWar
89
{
90
};
91
92
// GameTable Component
93
struct
GameTable
94
{
95
std::string
gameTableName
;
96
};
97
98
struct
ActiveBoard
99
{
100
};
101
102
// Notes Component
103
struct
Notes
104
{
105
std::vector<flecs::entity>
notes
;
106
};
107
108
struct
NoteComponent
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
//};
ActiveBoard
Definition
Components.h:99
Board
Definition
Components.h:75
Board::board_name
std::string board_name
Definition
Components.h:76
FogOfWar
Definition
Components.h:89
GameTable
Definition
Components.h:94
GameTable::gameTableName
std::string gameTableName
Definition
Components.h:95
Grid
Definition
Components.h:64
Grid::snap_to_grid
bool snap_to_grid
Definition
Components.h:68
Grid::offset
glm::vec2 offset
Definition
Components.h:65
Grid::opacity
float opacity
Definition
Components.h:70
Grid::cell_size
float cell_size
Definition
Components.h:66
Grid::is_hex
bool is_hex
Definition
Components.h:67
Grid::visible
bool visible
Definition
Components.h:69
Identifier
Definition
Components.h:13
Identifier::id
uint64_t id
Definition
Components.h:14
MarkerComponent
Definition
Components.h:80
MarkerComponent::ownerPeerUsername
std::string ownerPeerUsername
Definition
Components.h:82
MarkerComponent::ownerUniqueId
std::string ownerUniqueId
Definition
Components.h:81
MarkerComponent::allowAllPlayersMove
bool allowAllPlayersMove
Definition
Components.h:83
MarkerComponent::locked
bool locked
Definition
Components.h:84
Moving
Definition
Components.h:39
Moving::isDragging
bool isDragging
Definition
Components.h:40
NoteComponent
Definition
Components.h:109
NoteComponent::creation_date
std::string creation_date
Definition
Components.h:114
NoteComponent::last_update
std::string last_update
Definition
Components.h:115
NoteComponent::uuid
std::string uuid
Definition
Components.h:110
NoteComponent::shared_from
std::string shared_from
Definition
Components.h:122
NoteComponent::has_conflict
bool has_conflict
Definition
Components.h:121
NoteComponent::saved_locally
bool saved_locally
Definition
Components.h:120
NoteComponent::markdown_text
std::string markdown_text
Definition
Components.h:112
NoteComponent::title
std::string title
Definition
Components.h:111
NoteComponent::author
std::string author
Definition
Components.h:113
NoteComponent::open_editor
bool open_editor
Definition
Components.h:117
NoteComponent::shared
bool shared
Definition
Components.h:119
NoteComponent::selected
bool selected
Definition
Components.h:118
Notes
Definition
Components.h:104
Notes::notes
std::vector< flecs::entity > notes
Definition
Components.h:105
Panning
Definition
Components.h:58
Panning::isPanning
bool isPanning
Definition
Components.h:59
Position
Definition
Components.h:19
Position::y
float y
Definition
Components.h:21
Position::x
float x
Definition
Components.h:20
Size
Definition
Components.h:26
Size::height
float height
Definition
Components.h:28
Size::width
float width
Definition
Components.h:27
TextureComponent
Definition
Components.h:45
TextureComponent::size
glm::vec2 size
Definition
Components.h:48
TextureComponent::textureID
GLuint textureID
Definition
Components.h:46
TextureComponent::image_path
std::string image_path
Definition
Components.h:47
Visibility
Definition
Components.h:33
Visibility::isVisible
bool isVisible
Definition
Components.h:34
include
Components.h
Generated by
1.10.0