-
Notifications
You must be signed in to change notification settings - Fork 2
/
SolarSystemResourceEntry.cpp
110 lines (91 loc) · 2.33 KB
/
SolarSystemResourceEntry.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include "stdafx.h"
#include "SolarSystemResourceEntry.h"
/// AUTOGENERATED METHODS ///
size_t SolarSystemResourceEntryFactory::GetTypes(uint32_t* pDstTypes, size_t count) const {
if (count >= 1) {
pDstTypes[0] = SolarSystemResourceEntry::NOUN_ID;
return 1;
}
return 0;
}
Object* SolarSystemResourceEntryFactory::Create(uint32_t type, ICoreAllocator* pAllocator) {
return new SolarSystemResourceEntry();
}
const char* SolarSystemResourceEntryFactory::GetName(uint32_t type) const {
return "SolarSystemResourceEntry";
}
SolarSystemResourceEntry::SolarSystemResourceEntry(uint32_t StarID)
{
init(StarID);
}
SolarSystemResourceEntry::SolarSystemResourceEntry()
{
init(0);
}
SolarSystemResourceEntry::~SolarSystemResourceEntry()
{
}
int SolarSystemResourceEntry::AddRef() {
return DefaultRefCounted::AddRef();
}
int SolarSystemResourceEntry::Release() {
return DefaultRefCounted::Release();
}
uint32_t SolarSystemResourceEntry::GetCastID() const {
return TYPE;
}
uint32_t SolarSystemResourceEntry::GetNounID() const {
return NOUN_ID;
}
void* SolarSystemResourceEntry::Cast(uint32_t type) const {
CLASS_CAST(SolarSystemResourceEntry);
PARENT_CAST(cGameData);
return nullptr;
}
bool SolarSystemResourceEntry::Write(Simulator::ISerializerStream* stream)
{
return Simulator::ClassSerializer(this, ATTRIBUTES).Write(stream);
}
bool SolarSystemResourceEntry::WriteToXML(Simulator::XmlSerializer* writexml)
{
return false;
}
bool SolarSystemResourceEntry::Read(Simulator::ISerializerStream* stream)
{
return Simulator::ClassSerializer(this, ATTRIBUTES).Read(stream);
}
void SolarSystemResourceEntry::init(uint32_t StarID)
{
SystemID = StarID;
energy = 0;
energycap = 10;
}
int SolarSystemResourceEntry::GetEnergy()
{
return energy;
}
bool SolarSystemResourceEntry::SetEnergy(int value)
{ //returns true if not crash
energy = value;
return true;
}
int SolarSystemResourceEntry::GetEnergyCap()
{
return energycap;
}
bool SolarSystemResourceEntry::SetEnergyCap(int value)
{ //returns true if not crash
energycap = value;
return true;
}
float SolarSystemResourceEntry::GetEnergyPercentage()
{
return energy/energycap;
}
/// END OF AUTOGENERATED METHODS ///
////////////////////////////////////
Simulator::Attribute SolarSystemResourceEntry::ATTRIBUTES[] = {
// Add more attributes here
// This one must always be at the end
Simulator::Attribute()
};