xoreos  0.0.5
action.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 
27 namespace Engines {
28 
29 namespace KotOR {
30 
31 Action::Action(ActionType type) : _type(type), _object(0), _range(0.0f) {
32  _point[0] = _point[1] = _point[2] = 0.0f;
33 }
34 
35 Action::Action(const Action &action) : _type(action._type) {
36  _point[0] = action._point[0];
37  _point[1] = action._point[1];
38  _point[2] = action._point[2];
39 
40  _object = action._object;
41  _range = action._range;
42 }
43 
44 void Action::setPoint(float x, float y, float z) {
45  _point[0] = x;
46  _point[1] = y;
47  _point[2] = z;
48 }
49 
51  _object = o;
52 }
53 
54 void Action::setRange(float range) {
55  _range = range;
56 }
57 
59  return _type;
60 }
61 
62 void Action::getPoint(float &x, float &y, float &z) const {
63  x = _point[0];
64  y = _point[1];
65  z = _point[2];
66 }
67 
69  return _object;
70 }
71 
72 float Action::getRange() const {
73  return _range;
74 }
75 
76 } // End of namespace KotOR
77 
78 } // End of namespace Engines
Object * _object
Definition: action.h:53
ActionType _type
Definition: action.h:51
ActionType getType() const
Definition: action.cpp:58
void setPoint(float x, float y, float z)
Definition: action.cpp:44
void setRange(float range)
Definition: action.cpp:54
Object * getObject() const
Definition: action.cpp:68
Creature action in Star Wars: Knights of the Old Republic.
Action(ActionType type)
Definition: action.cpp:31
float getRange() const
Definition: action.cpp:72
void getPoint(float &x, float &y, float &z) const
Definition: action.cpp:62
void setObject(Object *o)
Definition: action.cpp:50