forked from Fluorohydride/ygopro-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
duel.h
65 lines (58 loc) · 1.33 KB
/
duel.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
/*
* duel.h
*
* Created on: 2010-4-8
* Author: Argon
*/
#ifndef DUEL_H_
#define DUEL_H_
#include "common.h"
#include "mtrandom.h"
#include <set>
#include <unordered_set>
class card;
class group;
class effect;
class field;
class interpreter;
class duel {
public:
using card_set = std::set<card*, card_sort>;
char strbuffer[256];
byte buffer[0x1000];
uint32 bufferlen;
byte* bufferp;
interpreter* lua;
field* game_field;
mtrandom random;
std::unordered_set<card*> cards;
std::unordered_set<card*> assumes;
std::unordered_set<group*> groups;
std::unordered_set<group*> sgroups;
std::unordered_set<effect*> effects;
std::unordered_set<effect*> uncopy;
duel();
~duel();
void clear();
card* new_card(uint32 code);
group* new_group();
group* new_group(card* pcard);
group* new_group(const card_set& cset);
effect* new_effect();
void delete_card(card* pcard);
void delete_group(group* pgroup);
void delete_effect(effect* peffect);
void release_script_group();
void restore_assumes();
int32 read_buffer(byte* buf);
void write_buffer32(uint32 value);
void write_buffer16(uint16 value);
void write_buffer8(uint8 value);
void clear_buffer();
void set_responsei(uint32 resp);
void set_responseb(byte* resp);
int32 get_next_integer(int32 l, int32 h);
private:
group* register_group(group* pgroup);
};
#endif /* DUEL_H_ */