forked from sashavol/Frozlunky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity_spawn_builder.h
72 lines (52 loc) · 1.33 KB
/
entity_spawn_builder.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
70
71
72
#pragma once
#include "patches.h"
#include "game_hooks.h"
#include <set>
#include <map>
bool is_special_entity(int entity);
class EntitySpawnBuilder {
public:
struct EntitySpawn {
int entity;
private:
float x;
float y;
public:
EntitySpawn(float x, float y, int entity);
EntitySpawn();
float x_pos() const;
float y_pos() const;
friend class EntitySpawnBuilder;
};
private:
typedef std::map<std::pair<float, float>, EntitySpawn> holder_type;
public:
typedef holder_type::const_iterator const_iterator;
public:
std::shared_ptr<GameHooks> gh;
std::shared_ptr<DerandomizePatch> dp;
std::shared_ptr<Spelunky> spel;
private:
bool is_valid;
bool unapplied_changes;
holder_type entities;
Address spawn_entity_fn;
Address subroutine_alloc;
Address floats_alloc;
signed int arrow_trap_dir_offs;
private:
//prevent copy
EntitySpawnBuilder(const EntitySpawnBuilder& o);
public:
EntitySpawnBuilder(std::shared_ptr<GameHooks> gh);
~EntitySpawnBuilder();
void update_memory();
bool valid() const;
Address subroutine_addr() const;
void add(float x, float y, int entity);
const_iterator erase(const_iterator pos);
void clear();
const_iterator find(float x, float y) const;
const_iterator begin() const;
const_iterator end() const;
};