ScummVM API documentation
gravity_process.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ULTIMA8_WORLD_GRAVITYPROCESS_H
23#define ULTIMA8_WORLD_GRAVITYPROCESS_H
24
25#include "ultima/ultima8/kernel/process.h"
26
27namespace Ultima {
28namespace Ultima8 {
29
30class Item;
31class Actor;
32
33class GravityProcess : public Process {
34public:
36 GravityProcess(Item *item, int gravity);
37
38 // add (xs,ys,zs) to current speed vector
39 void move(int xs, int ys, int zs);
40 void setGravity(int gravity);
41
42 void init();
43
44 ENABLE_RUNTIME_CLASSTYPE()
45
46 void run() override;
47 void terminate() override;
48
49 Common::String dumpInfo() const override;
50
51 bool loadData(Common::ReadStream *rs, uint32 version);
52 void saveData(Common::WriteStream *ws) override;
53
54protected:
55 void fallStopped();
56
57 void actorFallStoppedU8(Actor *actor, int height);
58 void actorFallStoppedCru(Actor *actor, int height);
59
60 int _gravity;
61 int _xSpeed, _ySpeed, _zSpeed;
62};
63
64} // End of namespace Ultima8
65} // End of namespace Ultima
66
67#endif
Definition: stream.h:385
Definition: str.h:59
Definition: stream.h:77
Definition: actor.h:37
Definition: gravity_process.h:33
void saveData(Common::WriteStream *ws) override
save Process data
void terminate() override
terminate the process. This wakes up all processes waiting for it.
Common::String dumpInfo() const override
dump some info about this process to a string
Definition: item.h:42
Definition: process.h:38