Tramway SDK
attributes.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_EXTENSIONS_KITCHENSINK_ATTRIBUTES_H
5#define TRAM_SDK_EXTENSIONS_KITCHENSINK_ATTRIBUTES_H
6
7#include <vector>
8
9#include <framework/uid.h>
10
11namespace tram::Ext::Kitchensink {
12
13enum : int {
16};
17
18struct Attribute {
20 float value;
21};
22
26 float value;
27 int flags;
28 float time;
29};
30
32 float GetAttribute(name_t attribute);
33 float GetBaseAttribute(name_t attribute);
34
35 void SetAttribute(name_t attribute, float value);
36
37 void ApplyModifier(AttributeModifier modifier);
38 void RemoveModifier(name_t tag);
39
40 bool HasAttribute(name_t type);
41
42 void Tick();
43
44 std::vector<Attribute> attributes;
45 std::vector<AttributeModifier> modifiers;
46};
47
48
49}
50
51#endif // TRAM_SDK_EXTENSIONS_KITCHENSINK_ATTRIBUTES_H
Definition: ai.cpp:16
@ ATTRIBUTE_MODIFIER_ADD
Definition: attributes.h:14
@ ATTRIBUTE_MODIFIER_MULTIPLY
Definition: attributes.h:15
float GetAttribute(name_t attribute)
Definition: attributes.cpp:9
void Tick()
Definition: attributes.cpp:56
void ApplyModifier(AttributeModifier modifier)
Definition: attributes.cpp:43
std::vector< AttributeModifier > modifiers
Definition: attributes.h:45
std::vector< Attribute > attributes
Definition: attributes.h:44
bool HasAttribute(name_t type)
Definition: attributes.cpp:52
void RemoveModifier(name_t tag)
Definition: attributes.cpp:48
void SetAttribute(name_t attribute, float value)
Definition: attributes.cpp:34
float GetBaseAttribute(name_t attribute)
Definition: attributes.cpp:27
Definition: attributes.h:18
name_t name
Definition: attributes.h:19
float value
Definition: attributes.h:20
name_t tag
Definition: attributes.h:25
float value
Definition: attributes.h:26
float time
Definition: attributes.h:28
name_t name
Definition: attributes.h:24
int flags
Definition: attributes.h:27
Definition: uid.h:11