-
Notifications
You must be signed in to change notification settings - Fork 2
/
DrillBuilding.cpp
126 lines (99 loc) · 3.05 KB
/
DrillBuilding.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include "stdafx.h"
#include "DrillBuilding.h"
using namespace Simulator;
DrillBuilding::DrillBuilding(Vector3 pos) {
position = pos;
App::ConsolePrintF("SEEEEEEEEEX");
auto model = simulator_new<Simulator::cInteractableObject>();
object_cast<Simulator::cInteractableObject>(model)->SetModelKey({ id("EP1_sg_rare_fossils_04"), TypeIDs::prop, GroupIDs::CivicObjects });
}
DrillBuilding::DrillBuilding()
{
pid = 0;
modelPtr = nullptr;
position = Vector3::ZERO;
}
DrillBuilding::~DrillBuilding() {
}
/// AUTOGENERATED METHODS ///
size_t DrillBuildingFactory::GetTypes(uint32_t* pDstTypes, size_t count) const {
if (count >= 1) {
pDstTypes[0] = DrillBuilding::NOUN_ID;
return 1;
}
return 0;
}
Object* DrillBuildingFactory::Create(uint32_t type, ICoreAllocator* pAllocator) {
return new DrillBuilding();
}
const char* DrillBuildingFactory::GetName(uint32_t type) const {
return "DrillBuilding";
}
int DrillBuilding::AddRef() {
return DefaultRefCounted::AddRef();
}
int DrillBuilding::Release() {
return DefaultRefCounted::Release();
}
uint32_t DrillBuilding::GetCastID() const {
return TYPE;
}
uint32_t DrillBuilding::GetNounID() const {
return NOUN_ID;
}
void* DrillBuilding::Cast(uint32_t type) const {
CLASS_CAST(DrillBuilding);
PARENT_CAST(cGameData);
return nullptr;
}
bool DrillBuilding::Write(Simulator::ISerializerStream* stream)
{
return Simulator::ClassSerializer(this, ATTRIBUTES).Write(stream);
}
bool DrillBuilding::WriteToXML(Simulator::XmlSerializer* writexml)
{
return false;
}
bool DrillBuilding::Read(Simulator::ISerializerStream* stream)
{
return Simulator::ClassSerializer(this, ATTRIBUTES).Read(stream);
}
void DrillBuilding::init(Vector3 pos, uint32_t PlanetID)
{
position = pos;
App::ConsolePrintF("SEEEEEEEEEX");
pid = PlanetID;
modelPtr = GameNounManager.CreateInstance(kOrnament);
object_cast<cSpatialObject>(modelPtr)->SetModelKey({ id("ep1_ci_spice_pumpstation"), TypeIDs::prop, GroupIDs::CivicObjects });
Vector3 direction = { 0, 0, 1 };
Quaternion orientation = PlanetModel.GetOrientation(position, direction);
object_cast<cSpatialObject>(modelPtr)->SetPosition(position);
object_cast<cSpatialObject>(modelPtr)->SetOrientation(orientation);
//auto model = simulator_new<Simulator::cInteractableObject>();
}
bool DrillBuilding::render()
{
modelPtr.reset();
modelPtr = GameNounManager.CreateInstance(kOrnament);
object_cast<cSpatialObject>(modelPtr)->SetModelKey({ id("ep1_ci_spice_pumpstation"), TypeIDs::prop, GroupIDs::CivicObjects });
Vector3 direction = { 0, 0, 1 };
Quaternion orientation = PlanetModel.GetOrientation(position, direction);
object_cast<cSpatialObject>(modelPtr)->SetPosition(position);
object_cast<cSpatialObject>(modelPtr)->SetOrientation(orientation);
return false;
}
uint32_t DrillBuilding::getPlanetID()
{
return pid;
}
Vector3 DrillBuilding::getPosition()
{
return position;
}
/// END OF AUTOGENERATED METHODS ///
////////////////////////////////////
Simulator::Attribute DrillBuilding::ATTRIBUTES[] = {
// Add more attributes here
// This one must always be at the end
Simulator::Attribute()
};