-
Notifications
You must be signed in to change notification settings - Fork 0
/
GAM_TrainCar.h
60 lines (40 loc) · 1.31 KB
/
GAM_TrainCar.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
#ifndef GAM_TRAINCAR_H
#define GAM_TRAINCAR_H
//--------------------------------------------------------------------------------
#include "GAM_Map.h"
//--------------------------------------------------------------------------------
// klasa informacji o ruchu wagonu
class GAM_MoveInfo
{
public:
int nextDir; // nastepny kierunek
int x; // pozycja pola
int y;
GAM_MoveInfo(int _nd, int _x, int _y);
};
//--------------------------------------------------------------------------------
// klasa wagonu pociagu
class GAM_TrainCar : public GAM_Object
{
private:
std::list<GAM_MoveInfo> moves; // lista ruchow wagonu
public:
float speedX; // predkosci wagonu
float speedY;
int prevX; // poprzednia znormalizowana pozycja wagonu
int prevY;
int dir; // kierunek wagonu
int baseSprite; // podstawowy sprite grafiki wagonu
bool locomotive; // flaga okreslajaca czy wagon jest lokomotywa
GAM_TrainCar(int _sprite, int _x, int _y, bool _loc, int _tSize);
// ustawienie kierunku ruchu wagonu
void SetDir(int _dir);
// dodanie ruchu
void AddMove(GAM_MoveInfo mv);
// wyczyszczenie listy ruchow
void ClearMoves();
// wykonanie kolejnego ruchu
void NextMove(int _x, int _y);
};
//--------------------------------------------------------------------------------
#endif