-
Notifications
You must be signed in to change notification settings - Fork 1
/
EntityChest.h
69 lines (66 loc) · 2.86 KB
/
EntityChest.h
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
#pragma once
#include "4dm.h"
#include "InventoryGrid.h"
#include "InventorySession.h"
namespace fdm
{
class EntityChest : public Entity
{
public:
inline static const int COLS = 4;
inline static const int ROWS = 8;
inline static const int SLOTS = 32;
glm::vec4 pos; // 0x20
InventoryGrid inventory; // 0x30
InventorySession openInstance; // 0xB0
inline static MeshRenderer* wireframeRenderer = reinterpret_cast<MeshRenderer*>((base + 0x2788E8));
bool isClickable() override
{
return reinterpret_cast<bool (__thiscall*)(EntityChest* self)>(getFuncAddr((int)Func::EntityChest::isClickable))(this);
}
stl::string getName() override
{
stl::string result;
return reinterpret_cast<stl::string& (__thiscall*)(EntityChest* self, stl::string* result)>(getFuncAddr((int)Func::EntityChest::getName))(this, &result);
return result;
}
void update(World* world, double dt) override
{
return reinterpret_cast<void (__thiscall*)(EntityChest* self, World* world, double dt)>(getFuncAddr((int)Func::EntityChest::update))(this, world, dt);
}
void render(const World* world, const m4::Mat5& MV, bool glasses) override
{
return reinterpret_cast<void (__thiscall*)(EntityChest* self, const World* world, const m4::Mat5& MV, bool glasses)>(getFuncAddr((int)Func::EntityChest::render))(this, world, MV, glasses);
}
nlohmann::json saveAttributes() override
{
nlohmann::json result;
return reinterpret_cast<nlohmann::json& (__thiscall*)(EntityChest* self, nlohmann::json* result)>(getFuncAddr((int)Func::EntityChest::saveAttributes))(this, &result);
return result;
}
nlohmann::json getServerUpdateAttributes() override
{
nlohmann::json result;
return reinterpret_cast<nlohmann::json& (__thiscall*)(EntityChest* self, nlohmann::json* result)>(getFuncAddr((int)Func::EntityChest::getServerUpdateAttributes))(this, &result);
return result;
}
void applyServerUpdate(const nlohmann::json& j, World* world) override
{
return reinterpret_cast<void (__thiscall*)(EntityChest* self, const nlohmann::json& j, World* world)>(getFuncAddr((int)Func::EntityChest::applyServerUpdate))(this, j, world);
}
glm::vec4 getPos() override
{
glm::vec4 result;
return reinterpret_cast<glm::vec4& (__thiscall*)(EntityChest* self, glm::vec4* result)>(getFuncAddr((int)Func::EntityChest::getPos))(this, &result);
return result;
}
void setPos(const glm::vec4& pos) override
{
return reinterpret_cast<void (__thiscall*)(EntityChest* self, const glm::vec4& pos)>(getFuncAddr((int)Func::EntityChest::setPos))(this, pos);
}
bool action(World* world, Entity* actor, int action, const nlohmann::json& details) override
{
return reinterpret_cast<bool (__thiscall*)(EntityChest* self, World* world, Entity* actor, int action, const nlohmann::json& details)>(getFuncAddr((int)Func::EntityChest::action))(this, world, actor, action, details);
}
};
}