Debian Codegraph @

src/jj2/level/event/jj2event.h

raw symbols SCIP
1
2 /**
3 *
4 * @file jj2event.h
5 *
6 * Part of the OpenJazz project
7 *
8 * @par History:
9 * - 23rd August 2005: Created OpenJazz.h
10 * - 31st January 2006: Created level.h from parts of OpenJazz.h
11 * - 29th June 2010: Created jj2level.h from parts of level.h
12 * - 2nd July 2010: Created jj2event.h from parts of jj2level.h
13 *
14 * @par Licence:
15 * Copyright (c) 2005-2013 AJ Thomson
16 *
17 * OpenJazz is distributed under the terms of
18 * the GNU General Public License, version 2.0
19 *
20 */
21
22
23 #ifndef _JJ2EVENT_H
24 #define _JJ2EVENT_H
25
26
27 #include "level/movable.h"
28
29
30 // Classes
31
32 class Anim;
33
34 /// JJ2 level "movable" event
35 class JJ2Event : public Movable {
36
37 private:
38 JJ2Event* next;
39
40 protected:
41 unsigned char type;
42 int properties; ///< Event-specific options
43 unsigned int endTime; ///< Point at which the event will terminate
44 bool flipped; ///< Whether or not the sprite image should be flipped
45
46 JJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, int newProperties);
47
48 void destroy (unsigned int ticks);
49 bool prepareStep (unsigned int ticks, int msps);
50 bool prepareDraw (unsigned int ticks, int change);
51 JJ2Event* remove ();
52
53 public:
54 virtual ~JJ2Event ();
55
56 unsigned char getType ();
57
58 virtual JJ2Event* step (unsigned int ticks, int msps) = 0;
59 virtual void draw (unsigned int ticks, int change) = 0;
60
61 };
62
63 /// JJ2 level pickup event
64 class PickupJJ2Event : public JJ2Event {
65
66 private:
67 bool floating;
68
69 protected:
70 unsigned char animSet;
71
72 PickupJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF, int newProperties);
73 virtual ~PickupJJ2Event ();
74
75 JJ2Event* step (unsigned int ticks, int msps);
76
77 };
78
79 /// JJ2 level ammo
80 class AmmoJJ2Event : public PickupJJ2Event {
81
82 public:
83 AmmoJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF);
84 ~AmmoJJ2Event ();
85
86 void draw (unsigned int ticks, int change);
87
88 };
89
90 /// JJ2 level gold/silver coin
91 class CoinGemJJ2Event : public PickupJJ2Event {
92
93 private:
94 void mapPalette (Anim* anim, int start);
95
96 public:
97 CoinGemJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF);
98 ~CoinGemJJ2Event ();
99
100 void draw (unsigned int ticks, int change);
101
102 };
103
104 /// JJ2 level food
105 class FoodJJ2Event : public PickupJJ2Event {
106
107 public:
108 FoodJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF);
109 ~FoodJJ2Event ();
110
111 void draw (unsigned int ticks, int change);
112
113 };
114
115 /// JJ2 level spring
116 class SpringJJ2Event : public JJ2Event {
117
118 private:
119 unsigned char animSet;
120
121 public:
122 SpringJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF, int newProperties);
123 ~SpringJJ2Event ();
124
125 JJ2Event* step (unsigned int ticks, int msps);
126 void draw (unsigned int ticks, int change);
127
128 };
129
130
131 /// Unimplemented JJ2 level event
132 class OtherJJ2Event : public JJ2Event {
133
134 private:
135 unsigned char animSet;
136
137 public:
138 OtherJJ2Event (JJ2Event* newNext, int gridX, int gridY, unsigned char newType, bool TSF, int newProperties);
139 ~OtherJJ2Event ();
140
141 JJ2Event* step (unsigned int ticks, int msps);
142 void draw (unsigned int ticks, int change);
143
144 };
145
146 #endif
147