Elaztek Developer Hub
Blamite Game Engine - Guerilla  00309.02.03.21.0044.blamite
The tag editor for the Blamite Game Engine.
fields.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #ifndef GUERILLA
7 #define GUERILLA
8 #endif
9 
10 #ifdef GUERILLA_EXPORTS
11 #define GUERILLA_API __declspec(dllexport)
12 #else
13 #define GUERILLA_API __declspec(dllimport)
14 #endif
15 
16 class BlamTag;
17 class BlamPlugin;
18 
22 enum class BlamTagFieldType
23 {
24  Ascii,
25  StringId,
26  Int8,
27  Int16,
28  Int32,
29  Float32,
30  Bitfield8,
31  Bitfield16,
32  Bitfield32,
33  Enum8,
34  Enum16,
35  Enum32,
36  Block,
37  Dataref,
38  Tagref,
39  Comment,
40 
42 };
43 
44 class BlamTagField;
45 
54 {
55 private:
57  BlamPlugin* plugin = nullptr;
58 
59 public:
60  int offset = 0x0;
61  int length = 0x0;
62  bool visible = true;
63  std::string display_name = "";
64  std::string description = "";
65  std::string field_id = "";
66 
74 
80  BlamPluginField(BlamPluginField* _old_field);
81 
87  BlamTagFieldType GetType();
88 
95 
105  virtual BlamTagField* GenerateTagField(BlamTag* tag);
106 
116  virtual BlamTagField* GenerateTagField(BlamTagField* existing_tag_field);
117 
129  virtual BlamTagField* GenerateTagField(BlamTag* tag, void* address);
130 };
131 
139 {
140 private:
142  BlamTag* tag = nullptr;
143 
144 public:
145  BlamPluginField* plugin_field = nullptr;
146  std::string field_id = "";
147 
154  BlamTagField(BlamTag* _tag, BlamTagFieldType _type);
155 
161  virtual std::string GenerateXMLString();
162 
168  virtual std::vector<char> GetValueAsBytes();
169 
175  BlamTagFieldType GetType();
176 
182  BlamTag* GetTag();
183 
189  BlamPluginField* GetPluginField();
190 
196  bool HasPluginField();
197 };
198 
203 {
212 
220  GUERILLA BlamTagFieldType DetermineFieldType(std::string node_name);
221 }
BlamTagField
Class representing a tag field.
Definition: fields.h:138
BlamTagFieldType::Int16
@ Int16
Indicates that the field is a 16-bit integer.
BlamTagFieldType::Int32
@ Int32
Indicates that the field is a 32-bit integer.
Guerilla::Tags::Fields
Namespace containing functions relating to tag fields.
Definition: fields.h:202
BlamTagFieldType::Enum8
@ Enum8
Indicates that the field is an Enum8.
BlamTagFieldType::Block
@ Block
Indicates that the field is a tag block.
BlamTagFieldType::Ascii
@ Ascii
Indicates that the field is a string of text.
BlamTagFieldType::Dataref
@ Dataref
Indicates that the field is a data reference.
BlamTagFieldType::Enum16
@ Enum16
Indicates that the field is an Enum16.
BlamTagFieldType::Bitfield16
@ Bitfield16
Indicates that the field is a Bitfield16.
BlamTagFieldType
BlamTagFieldType
Enumerator containing all possible tag field types.
Definition: fields.h:22
Guerilla::Tags::GetPlugin
GUERILLA_API BlamPlugin * GetPlugin(std::string class_name)
Retrieves a plugin based on its name.
Definition: plugins.cpp:105
BlamTagFieldType::Int8
@ Int8
Indicates that the field is an 8-bit integer.
BlamTagFieldType::Comment
@ Comment
Indicates that the field is a comment. These do not store any tag data.
BlamTagFieldType::Float32
@ Float32
Indicates that the field is a Float32.
BlamPluginField
Class representing a plugin field.
Definition: fields.h:53
BlamTag
Class representing a Tag.
Definition: tags.h:128
BlamTagFieldType::Tagref
@ Tagref
Indicates that the field is a tag reference.
GUERILLA
#define GUERILLA
Definition: fields.h:7
Guerilla::Tags::Fields::DetermineFieldType
GUERILLA BlamTagFieldType DetermineFieldType(std::string node_name)
Determines the field type from a string, used to determine the field type when parsing XML tags and p...
Definition: fields.cpp:68
BlamPlugin
Class representing a Plugin.
Definition: tags.h:37
BlamTagFieldType::Bitfield8
@ Bitfield8
Indicates that the field is a Bitfield8.
GUERILLA_API
#define GUERILLA_API
Definition: fields.h:13
Guerilla::Tags::Fields::GetStandardFieldLength
GUERILLA int GetStandardFieldLength(BlamTagFieldType type)
Retrieves the length of a tag field.
Definition: fields.cpp:5
BlamTagFieldType::Unspecified
@ Unspecified
Indicates that the field's type is not specified. Fields with this type should be considered invalid.
BlamTagFieldType::StringId
@ StringId
Indicates that the field is a String ID.
BlamTagFieldType::Bitfield32
@ Bitfield32
Indicates that the field is a Bitfield32.
BlamTagFieldType::Enum32
@ Enum32
Indicates that the field is an Enum32.