136 |
void Init(); |
void Init(); |
137 |
|
|
138 |
// Create a new, empty world. |
// Create a new, empty world. |
139 |
void Create(int w, int h); |
void Create (int w, int h); |
140 |
bool Load(const string &name); |
bool Load (const string &name); |
141 |
|
|
142 |
/*! Initialize the world after loading it. Call this before |
/*! Initialize the world after loading it. Call this after |
143 |
actually starting the game. */ |
loading the world to force laser beams to be recalculated |
144 |
|
etc. */ |
145 |
void InitWorld(); |
void InitWorld(); |
146 |
|
|
147 |
void Tick(double dtime); |
void Tick(double dtime); |
149 |
// Destroy all objects etc. |
// Destroy all objects etc. |
150 |
void Shutdown(); |
void Shutdown(); |
151 |
|
|
152 |
void NameObject(Object *obj, const string &name); |
void NameObject (Object *obj, const string &name); |
153 |
Object *GetNamedObject(const string &name); |
void UnnameObject (Object *obj); |
154 |
void UnnameObject(Object *obj); |
Object *GetNamedObject (const string &name); |
155 |
|
|
156 |
//---------------------------------------- |
//---------------------------------------- |
157 |
// Force fields. |
// Force fields. |
158 |
//---------------------------------------- |
//---------------------------------------- |
|
void AddForceField(ForceField *ff); |
|
|
void RemoveForceField(ForceField *ff); |
|
|
void SetMouseForce(V2 f); |
|
159 |
|
|
160 |
|
void AddForceField (ForceField *ff); |
161 |
|
void RemoveForceField (ForceField *ff); |
162 |
|
void SetMouseForce (V2 f); |
163 |
|
|
164 |
//---------------------------------------- |
//---------------------------------------- |
165 |
// Rubber bands |
// Rubber bands |
177 |
void KillRubberBand (Actor *a, Stone *st); |
void KillRubberBand (Actor *a, Stone *st); |
178 |
|
|
179 |
/* Remove the rubber band between `a' and `a2'. If `a2' is 0, all |
/* Remove the rubber band between `a' and `a2'. If `a2' is 0, all |
180 |
rubber bands connecting `a' to another actor will be cut. */ |
rubber bands connecting `a' to other actors will be cut. */ |
181 |
void KillRubberBand (Actor *a, Actor *a2); |
void KillRubberBand (Actor *a, Actor *a2); |
182 |
|
|
183 |
/* Remove all rubber bands attached to stone ST. */ |
/* Remove all rubber bands attached to stone ST. */ |
189 |
|
|
190 |
|
|
191 |
//---------------------------------------- |
//---------------------------------------- |
192 |
// Actor access |
// Signals |
193 |
//---------------------------------------- |
//---------------------------------------- |
194 |
void AddActor(double x, double y, Actor* a); |
|
195 |
|
void AddSignal (Object *src, Object *dst, const string &msg); |
196 |
|
void EmitSignals (Object *src); |
197 |
|
|
198 |
|
//---------------------------------------- |
199 |
|
// Actors |
200 |
|
//---------------------------------------- |
201 |
|
|
202 |
|
void AddActor(double x, double y, Actor* a); |
203 |
Actor *YieldActor(Actor *a); |
Actor *YieldActor(Actor *a); |
204 |
void WarpActor(Actor *a, double newx, double newy); |
void WarpActor(Actor *a, double newx, double newy); |
205 |
void GrabActor(Actor *a); |
void GrabActor(Actor *a); |
206 |
void ReleaseActor(Actor *a); |
void ReleaseActor(Actor *a); |
|
const ActorInfo &GetActorInfo(Actor *a); |
|
207 |
|
|
208 |
//---------------------------------------- |
//---------------------------------------- |
209 |
// Stone access |
// Stones |
210 |
//---------------------------------------- |
//---------------------------------------- |
211 |
void SetStone(GridPos p, Stone* st); |
|
212 |
Stone *GetStone(GridPos p); |
void SetStone(GridPos p, Stone* st); |
213 |
Stone *YieldStone(GridPos p); |
Stone *GetStone(GridPos p); |
214 |
void KillStone(GridPos p); |
Stone *YieldStone(GridPos p); |
215 |
|
void KillStone(GridPos p); |
216 |
|
|
217 |
/* Move the stone at position `p' in the specified direction `dir' |
/* Move the stone at position `p' in the specified direction `dir' |
218 |
if it is movable, and there is no stone at the new position. */ |
if it is movable, and there is no stone at the new position. */ |
219 |
bool MaybeMoveStone(GridPos p, Direction dir); |
bool MaybeMoveStone (GridPos p, Direction dir); |
220 |
void SwapStones(GridPos p, GridPos newp); |
void SwapStones (GridPos p, GridPos newp); |
221 |
|
|
222 |
//---------------------------------------- |
//---------------------------------------- |
223 |
// Item access |
// Items |
224 |
//---------------------------------------- |
//---------------------------------------- |
225 |
void SetItem(GridPos p, Item* st); |
void SetItem (GridPos p, Item* st); |
226 |
void KillItem(GridPos p); |
Item *GetItem (GridPos p); |
227 |
Item* GetItem(GridPos p); |
Item *YieldItem (GridPos p); |
228 |
|
void KillItem (GridPos p); |
|
/* Remove item from the world and yield it to the caller. This is |
|
|
used for transferring items to an inventory. [Note: This is |
|
|
quite different from `getting' an item with GetItem() in that |
|
|
it transfers ownership to the caller!] */ |
|
|
Item* YieldItem(GridPos p); |
|
229 |
|
|
230 |
//---------------------------------------- |
//---------------------------------------- |
231 |
// Floor access |
// Floors |
232 |
//---------------------------------------- |
//---------------------------------------- |
233 |
void SetFloor(GridPos p, Floor* st); |
void SetFloor (GridPos p, Floor* st); |
234 |
Floor* GetFloor(GridPos p); |
Floor *GetFloor (GridPos p); |
235 |
void KillFloor(GridPos p); |
void KillFloor (GridPos p); |
|
|
|
236 |
} |
} |
237 |
#endif |
#endif |