Elaztek Developer Hub
Blamite Game Engine - Strings  00311.03.29.21.1456.blamite
A library containing general purpose utilities and classes for use in multiple projects.
fields.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #ifndef STRINGS_INTERNAL
7 #define STRINGS_INTERNAL
8 #endif
9 
10 #ifdef STRINGS_EXPORTS
11 #define STRINGS_API __declspec(dllexport)
12 #else
13 #define STRINGS_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 
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.
STRINGS_API
#define STRINGS_API
Definition: fields.h:13
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
STRINGS_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::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:123
BlamTagFieldType::Tagref
@ Tagref
Indicates that the field is a tag reference.
STRINGS_INTERNAL
#define STRINGS_INTERNAL
Definition: fields.h:7
BlamConfigurationSettingType::Comment
@ Comment
Used to indicate a comment within the file.
Guerilla::Tags::Fields::DetermineFieldType
STRINGS_INTERNAL 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:76
BlamPlugin
Class representing a Plugin.
Definition: tags.h:32
BlamTagFieldType::Bitfield8
@ Bitfield8
Indicates that the field is a Bitfield8.
Guerilla::Tags::Fields::GetStandardFieldLength
STRINGS_INTERNAL 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.