xoreos  0.0.5
functions_object.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/util.h"
26 
28 
34 
36 
37 namespace Engines {
38 
39 namespace KotOR2 {
40 
42  ctx.getReturn() = ctx.getTriggerer();
43 }
44 
46  // TODO: This should return the *last* entered object, i.e. it should remember past triggerers.
47  ctx.getReturn() = ctx.getTriggerer();
48 }
49 
51  // TODO: This should return the *last* exited object, i.e. it should remember past triggerers.
52  ctx.getReturn() = ctx.getTriggerer();
53 }
54 
56  ctx.getReturn() = getParamObject(ctx, 0) != 0;
57 }
58 
61 }
62 
65 }
66 
68  Common::UString name = ctx.getParams()[0].getString();
69  int nth = ctx.getParams()[1].getInt();
70 
72  for (int i = 0; i < nth; ++i) {
73  search->next();
74  }
75 
76  ctx.getReturn() = search->get();
77 }
78 
79 } // End of namespace KotOR2
80 
81 } // End of namespace Engines
A class holding an UTF-8 string.
Definition: ustring.h:48
The context handling the gameplay in Star Wars: Knights of the Old Republic II - The Sith Lords...
A container of Star Wars: Knights of the Old Republic II - The Sith Lords objects.
Context of an NWScript function.
static Creature * toPartyMember(Aurora::NWScript::Object *object)
An object in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
Utility templates and functions.
Basic Star Wars: Knights of the Old Republic II - The Sith Lords type definitions.
void getIsPC(Aurora::NWScript::FunctionContext &ctx)
Star Wars: Knights of the Old Republic II - The Sith Lords engine functions.
Module & getModule()
Return the module context.
Definition: game.cpp:63
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
ObjectSearch * findObjectsByTag(const Common::UString &tag) const
Return a search context to iterate over all objects with this tag.
static Creature * toPC(Aurora::NWScript::Object *object)
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:115
void isObjectPartyMember(Aurora::NWScript::FunctionContext &ctx)
void getIsObjectValid(Aurora::NWScript::FunctionContext &ctx)
void getExitingObject(Aurora::NWScript::FunctionContext &ctx)
void getEnteringObject(Aurora::NWScript::FunctionContext &ctx)
void getClickingObject(Aurora::NWScript::FunctionContext &ctx)