ScummVM API documentation
context.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 ULTIMA4_GAME_CONTEXT_H
23 #define ULTIMA4_GAME_CONTEXT_H
24 
25 #include "ultima/ultima4/map/location.h"
26 #include "ultima/ultima4/game/aura.h"
27 #include "ultima/ultima4/game/names.h"
28 #include "ultima/ultima4/game/person.h"
29 #include "ultima/ultima4/game/script.h"
30 #include "ultima/ultima4/core/types.h"
31 #include "ultima/ultima4/filesys/savegame.h"
32 
33 namespace Ultima {
34 namespace Ultima4 {
35 
36 class Object;
37 class Party;
38 class Person;
39 class Script;
40 class StatsArea;
41 
42 enum TransportContext {
43  TRANSPORT_FOOT = 0x1,
44  TRANSPORT_HORSE = 0x2,
45  TRANSPORT_SHIP = 0x4,
46  TRANSPORT_BALLOON = 0x8,
47  TRANSPORT_FOOT_OR_HORSE = TRANSPORT_FOOT | TRANSPORT_HORSE,
48  TRANSPORT_ANY = 0xffff
49 };
50 
54 class Context : public Script::Provider {
55 public:
56  Context();
57  ~Context();
58 
62  void reset();
63 
64  StatsArea *_stats;
65  Aura *_aura;
66  Party *_party;
67  Location *_location;
68  int _line, _col;
69  int _moonPhase;
70  int _windDirection;
71  int _windCounter;
72  bool _windLock;
73  int _horseSpeed;
74  int _opacity;
75  TransportContext _transportContext;
76  uint32 _lastCommandTime;
77  Object *_lastShip;
78 public:
83  if (parts.size() == 1) {
84  if (parts[0] == "wind")
85  return getDirectionName(static_cast<Direction>(_windDirection));
86  }
87  return "";
88  }
89 };
90 
91 extern Context *g_context;
92 
93 } // End of namespace Ultima4
94 } // End of namespace Ultima
95 
96 #endif
Definition: context.h:54
Definition: str.h:59
Definition: stats.h:65
Definition: script.h:55
Common::String translate(Common::Array< Common::String > &parts) override
Definition: context.h:82
Definition: detection.h:27
Definition: player.h:285
Definition: object.h:43
Definition: location.h:49
Definition: aura.h:33
size_type size() const
Definition: array.h:316