-
Notifications
You must be signed in to change notification settings - Fork 0
/
position.h
43 lines (34 loc) · 949 Bytes
/
position.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
#include <cstdio>
#include <vector>
using namespace std;
class Position;
#ifndef POSITION_H
#define POSITION_H
#include "sobject.h"
class Position : public SObject {
public:
Position();
Position(FILE *);
virtual ~Position();
virtual void TakeTurn();
virtual int SType() { return SOBJECT_POSITION; }
SObject *Represents() { return represents; }
virtual const char *Name();
void SaveTo(FILE *);
void LoadFrom(FILE *);
protected:
Position *next;
SObject *represents;
virtual void ComputeSPos();
virtual void ComputeGPos();
void AssignTo(SObject *);
friend Position *GetPosition(SObject *);
friend void RecyclePosition(Position *);
friend void CleanPositions(vector<SObject*>&);
friend void RemapPositions(SObject *oldo, SObject *newo);
};
Position *GetPosition(SObject *);
void RecyclePosition(Position *);
void CleanPositions(vector<SObject*>&);
void RemapPositions(SObject *oldo, SObject *newo);
#endif