-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit.d
29 lines (26 loc) · 822 Bytes
/
unit.d
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
module unit;
import jeca.all;
import board, unitlist;
abstract class Unit {
private:
Unit m_previous, m_next;
int m_mainType; // e.g ship, lazer
int m_player;
Bmp m_sprite;
double m_xpos, m_ypos, m_dirx, m_diry;
public:
@property ref auto xpos() { return m_xpos; }
@property ref auto ypos() { return m_ypos; }
@property ref auto dirx() { return m_dirx; }
@property ref auto diry() { return m_diry; }
@property ref auto sprite() { return m_sprite; }
@property ref auto previous() { return m_previous; }
@property ref auto next() { return m_next; }
@property ref auto mainType() { return m_mainType; }
@property ref auto player() { return m_player; }
void process( Board, UnitList ) {}
void draw() {}
void selfDestruct( UnitList unitList ) {
unitList.remove( this );
}
}