xoreos  0.0.5
functions_situated.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 
26 
30 
32 
33 namespace Engines {
34 
35 namespace KotOR2 {
36 
39 
40  ctx.getReturn() = situated ? situated->isLocked() : 0;
41 }
42 
45  if (situated)
46  situated->setLocked(ctx.getParams()[1].getInt() != 0);
47 }
48 
51 
52  ctx.getReturn() = situated ? situated->isOpen() : 0;
53 }
54 
56  ctx.getReturn() = (Aurora::NWScript::Object *) 0;
57 
59  if (!situated)
60  return;
61 
62  ctx.getReturn() = (Aurora::NWScript::Object *) situated->getLastOpenedBy();
63 }
64 
66  ctx.getReturn() = (Aurora::NWScript::Object *) 0;
67 
69  if (!situated)
70  return;
71 
72  ctx.getReturn() = (Aurora::NWScript::Object *) situated->getLastClosedBy();
73 }
74 
76  ctx.getReturn() = (Aurora::NWScript::Object *) 0;
77 
79  if (!situated)
80  return;
81 
82  ctx.getReturn() = (Aurora::NWScript::Object *) situated->getLastUsedBy();
83 }
84 
85 } // End of namespace KotOR2
86 
87 } // End of namespace Engines
Object * getLastOpenedBy() const
Return the object that last opened this situated object.
Definition: situated.cpp:105
Object * getLastUsedBy() const
Return the object that last used this situated object.
Definition: situated.cpp:113
A container of Star Wars: Knights of the Old Republic II - The Sith Lords objects.
Context of an NWScript function.
void getLastClosedBy(Aurora::NWScript::FunctionContext &ctx)
An object in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
void getIsOpen(Aurora::NWScript::FunctionContext &ctx)
Star Wars: Knights of the Old Republic II - The Sith Lords engine functions.
bool isLocked() const
Is the situated object locked?
Definition: situated.cpp:97
void getLocked(Aurora::NWScript::FunctionContext &ctx)
A situated object in a Star Wars: Knights of the Old Republic II - The Sith Lords area...
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:115
virtual bool isOpen() const =0
Is the situated object open?
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
Definition: situated.cpp:101
void setLocked(Aurora::NWScript::FunctionContext &ctx)
void getLastUsedBy(Aurora::NWScript::FunctionContext &ctx)
static Situated * toSituated(Aurora::NWScript::Object *object)
void getLastOpenedBy(Aurora::NWScript::FunctionContext &ctx)
Object * getLastClosedBy() const
Return the object that last closed this situated object.
Definition: situated.cpp:109