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>
28
29namespace neogfx::game
30{
31 struct patch
32 {
35
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}
std::vector< patch > patches
Definition patch.hpp:88
std::vector< face > faces
Definition i_ecs.hpp:36
static const neolib::uuid & id()
Definition material.hpp:47
static const i_string & field_name(uint32_t aFieldIndex)
Definition patch.hpp:76
static component_data_field_type field_type(uint32_t aFieldIndex)
Definition patch.hpp:52
static neolib::uuid field_type_id(uint32_t aFieldIndex)
Definition patch.hpp:64
static const neolib::uuid & id()
Definition patch.hpp:38
static const i_string & name()
Definition patch.hpp:43
static uint32_t field_count()
Definition patch.hpp:48
material material
Definition patch.hpp:33