neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
patch.hpp
Go to the documentation of this file.
1
// patch.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include <
neolib/core/uuid.hpp
>
24
#include <
neolib/core/string.hpp
>
25
#include <
neogfx/game/ecs_ids.hpp
>
26
#include <
neogfx/game/i_component_data.hpp
>
27
#include <
neogfx/game/material.hpp
>
28
29
namespace
neogfx::game
30
{
31
struct
patch
32
{
33
material
material
;
34
faces
faces
;
35
36
struct
meta
:
i_component_data::meta
37
{
38
static
const
neolib::uuid
&
id
()
39
{
40
static
const
neolib::uuid
sId = { 0x2a4e96aa, 0x2e1e, 0x48d7, 0xa384, { 0xb, 0xe8, 0x79, 0x3a, 0x7e, 0x94 } };
41
return
sId;
42
}
43
static
const
i_string
&
name
()
44
{
45
static
const
string
sName =
"Patch"
;
46
return
sName;
47
}
48
static
uint32_t
field_count
()
49
{
50
return
2;
51
}
52
static
component_data_field_type
field_type
(uint32_t aFieldIndex)
53
{
54
switch
(aFieldIndex)
55
{
56
case
0:
57
return
component_data_field_type::ComponentData;
58
case
1:
59
return
component_data_field_type::Face | component_data_field_type::Array;
60
default
:
61
throw
invalid_field_index
();
62
}
63
}
64
static
neolib::uuid
field_type_id
(uint32_t aFieldIndex)
65
{
66
switch
(aFieldIndex)
67
{
68
case
0:
69
return
material::meta::id
();
70
case
1:
71
return
neolib::uuid
{};
72
default
:
73
throw
invalid_field_index
();
74
}
75
}
76
static
const
i_string
&
field_name
(uint32_t aFieldIndex)
77
{
78
static
const
string
sFieldNames[] =
79
{
80
"Material"
,
81
"Faces"
82
};
83
return
sFieldNames[aFieldIndex];
84
}
85
};
86
};
87
88
typedef
std::vector<patch>
patches
;
89
}
neolib::i_string
Definition
i_string.hpp:49
material.hpp
neogfx::game
Definition
aabb_octree.hpp:31
neogfx::game::patches
std::vector< patch > patches
Definition
patch.hpp:88
neogfx::game::faces
std::vector< face > faces
Definition
i_ecs.hpp:36
neolib::ecs::component_data_field_type
component_data_field_type
Definition
i_component_data.hpp:52
ecs_ids.hpp
i_component_data.hpp
neogfx.hpp
string.hpp
neogfx::game::material::meta::id
static const neolib::uuid & id()
Definition
material.hpp:47
neogfx::game::material
Definition
material.hpp:37
neogfx::game::patch::meta
Definition
patch.hpp:37
neogfx::game::patch::meta::field_name
static const i_string & field_name(uint32_t aFieldIndex)
Definition
patch.hpp:76
neogfx::game::patch::meta::field_type
static component_data_field_type field_type(uint32_t aFieldIndex)
Definition
patch.hpp:52
neogfx::game::patch::meta::field_type_id
static neolib::uuid field_type_id(uint32_t aFieldIndex)
Definition
patch.hpp:64
neogfx::game::patch::meta::id
static const neolib::uuid & id()
Definition
patch.hpp:38
neogfx::game::patch::meta::name
static const i_string & name()
Definition
patch.hpp:43
neogfx::game::patch::meta::field_count
static uint32_t field_count()
Definition
patch.hpp:48
neogfx::game::patch
Definition
patch.hpp:32
neogfx::game::patch::faces
faces faces
Definition
patch.hpp:34
neogfx::game::patch::material
material material
Definition
patch.hpp:33
neolib::ecs::i_component_data::meta::invalid_field_index
Definition
i_component_data.hpp:134
neolib::ecs::i_component_data::meta
Definition
i_component_data.hpp:133
neolib::uuid
Definition
uuid.hpp:51
uuid.hpp
include
neogfx
game
patch.hpp
Generated by
1.9.8