xoreos  0.0.5
functions_global.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/ustring.h"
26 
28 
29 #include "src/engines/kotor/game.h"
31 
33 
34 namespace Engines {
35 
36 namespace KotOR {
37 
39  Common::UString id = ctx.getParams()[0].getString();
40 
42 }
43 
45  Common::UString id = ctx.getParams()[0].getString();
46  bool value = ctx.getParams()[1].getInt() != 0;
47 
48  _game->getModule().setGlobalBoolean(id, value);
49 }
50 
52  Common::UString id = ctx.getParams()[0].getString();
53 
55 }
56 
58  Common::UString id = ctx.getParams()[0].getString();
59  int value = ctx.getParams()[1].getInt();
60 
61  _game->getModule().setGlobalNumber(id, value);
62 }
63 
64 } // End of namespace KotOR
65 
66 } // End of namespace Engines
void setGlobalNumber(const Common::UString &id, int value)
Get a global number.
Definition: module.cpp:887
A class holding an UTF-8 string.
Definition: ustring.h:48
Context of an NWScript function.
void getGlobalBoolean(Aurora::NWScript::FunctionContext &ctx)
void setGlobalBoolean(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in Star Wars: Knights of the Old Republic.
void getGlobalNumber(Aurora::NWScript::FunctionContext &ctx)
Star Wars: Knights of the Old Republic engine functions.
Unicode string handling.
bool getGlobalBoolean(const Common::UString &id) const
Get a global boolean.
Definition: module.cpp:879
Module & getModule()
Return the module context.
Definition: game.cpp:65
void setGlobalBoolean(const Common::UString &id, bool value)
Set a global boolean.
Definition: module.cpp:875
The context needed to run a Star Wars: Knights of the Old Republic module.
int getGlobalNumber(const Common::UString &id) const
Set a global number.
Definition: module.cpp:891
void setGlobalNumber(Aurora::NWScript::FunctionContext &ctx)