Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IObject.h
Go to the documentation of this file.
1 // Copyright (C) 2004-2011 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 
21 #ifndef IOBJECT_H
22 #define IOBJECT_H
23 
24 #include "CCoreDLL.h"
25 #include "../Math_LIB/MMatrix3x3.h"
26 #include <string>
27 
28 namespace OpenSkyNet {
31  namespace Core {
32  class PhysicalObject;
33  class VisibleObject;
34 
36  class CORE_DLL Object {
37  public:
38  Object() {}
39  virtual ~Object() {}
40 
41  virtual Math::Point<> getPos() const = 0;
42  virtual void getPos(Math::Point<>& pos_) const = 0;
43  virtual void setPos(const Math::Point<>& pos_) = 0;
44  virtual bool getHasPosChanged() const = 0;
45  virtual void setHasPosChanged(bool val_) = 0;
46 
47  virtual Math::Matrix3x3 getRot() const = 0;
48  virtual void getRot(Math::Matrix3x3& rot_) const = 0;
49  virtual void setRot(const Math::Matrix3x3& rot_) = 0;
50  virtual bool getHasRotChanged() const = 0;
51  virtual void setHasRotChanged(bool val_) = 0;
52 
53  virtual Math::Point<> getVel() const = 0;
54  virtual void getVel(Math::Point<>& vel_) const = 0;
55  virtual void setVel(const Math::Point<>& vel_) = 0;
56  virtual bool getHasVelChanged() const = 0;
57  virtual void setHasVelChanged(bool val_) = 0;
58 
59  virtual Math::Point<> getAngVel() const = 0;
60  virtual void getAngVel(Math::Point<>& angVel_) const = 0;
61  virtual void setAngVel(const Math::Point<>& angVel_) = 0;
62  virtual bool getHasAngVelChanged() const = 0;
63  virtual void setHasAngVelChanged(bool val_) = 0;
64 
65  virtual const PhysicalObject* getPhysicalObject() const = 0;
66  virtual PhysicalObject* getPhysicalObject() = 0;
67  virtual const VisibleObject* getVisibleObject() const = 0;
68  virtual VisibleObject* getVisibleObject() = 0;
69 
70  virtual const std::string& getName() const = 0;
71  virtual void setName(const std::string& name_) = 0;
72  };
73 
75  class CORE_DLL ABCObject : public Object {
76  public:
77  ABCObject() : _hasPosChanged(false), _hasRotChanged(false),
78  _hasVelChanged(false), _hasAngVelChanged(false) {}
79  virtual ~ABCObject() {}
80 
81  virtual bool getHasPosChanged() const { return _hasPosChanged; }
82  virtual void setHasPosChanged(bool val_) { _hasPosChanged = val_; }
83 
84  virtual bool getHasRotChanged() const { return _hasRotChanged; }
85  virtual void setHasRotChanged(bool val_) { _hasRotChanged = val_; }
86 
87  virtual Math::Point<> getVel() const { return Math::g_origin; }
88  virtual void getVel(Math::Point<>& vel_) const { vel_ = Math::g_origin; }
89  virtual void setVel(const Math::Point<>& vel_) { UNUSED(vel_); }
90  virtual bool getHasVelChanged() const { return _hasVelChanged; }
91  virtual void setHasVelChanged(bool val_) { _hasVelChanged = val_; }
92 
93  virtual Math::Point<> getAngVel() const { return Math::g_origin; }
94  virtual void getAngVel(Math::Point<>& angVel_) const { angVel_ = Math::g_origin; }
95  virtual void setAngVel(const Math::Point<>& angVel_) { UNUSED(angVel_); }
96  virtual bool getHasAngVelChanged() const { return _hasAngVelChanged; }
97  virtual void setHasAngVelChanged(bool val_) { _hasAngVelChanged = val_; }
98 
99  virtual const PhysicalObject* getPhysicalObject() const { return 0; }
100  virtual PhysicalObject* getPhysicalObject() { return 0; }
101  virtual const VisibleObject* getVisibleObject() const { return 0; }
102  virtual VisibleObject* getVisibleObject() { return 0; }
103 
104  virtual const std::string& getName() const { return _name; }
105  virtual void setName(const std::string& name_) { _name = name_; }
106  protected:
107  std::string _name;
108  bool _hasPosChanged, _hasRotChanged, _hasVelChanged, _hasAngVelChanged;
109  };
110  }
111 }
112 
113 #endif //IOBJECT_H
Definition: CVisibleObject.h:28
bool _hasVelChanged
Definition: IObject.h:108
virtual void setVel(const Math::Point<> &vel_)
Definition: IObject.h:89
#define UNUSED(var)
Definition: UTypes.h:35
Definition: CPhysicalObject.h:33
virtual bool getHasAngVelChanged() const
Definition: IObject.h:96
virtual void getAngVel(Math::Point<> &angVel_) const
Definition: IObject.h:94
std::string _name
Definition: IObject.h:107
virtual bool getHasRotChanged() const
Definition: IObject.h:84
Object()
Definition: IObject.h:38
virtual void getVel(Math::Point<> &vel_) const
Definition: IObject.h:88
virtual Math::Point getVel() const
Definition: IObject.h:87
virtual void setHasVelChanged(bool val_)
Definition: IObject.h:91
virtual PhysicalObject * getPhysicalObject()
Definition: IObject.h:100
virtual void setName(const std::string &name_)
Definition: IObject.h:105
virtual ~ABCObject()
Definition: IObject.h:79
const Point g_origin
Definition: MPoint.cpp:5
virtual Math::Point getAngVel() const
Definition: IObject.h:93
virtual bool getHasPosChanged() const
Definition: IObject.h:81
#define CORE_DLL
Definition: CCoreDLL.h:57
virtual void setAngVel(const Math::Point<> &angVel_)
Definition: IObject.h:95
virtual bool getHasVelChanged() const
Definition: IObject.h:90
Definition: MPoint.h:33
virtual VisibleObject * getVisibleObject()
Definition: IObject.h:102
Definition: IObject.h:36
Definition: IObject.h:75
virtual void setHasAngVelChanged(bool val_)
Definition: IObject.h:97
virtual void setHasPosChanged(bool val_)
Definition: IObject.h:82
virtual const VisibleObject * getVisibleObject() const
Definition: IObject.h:101
virtual const std::string & getName() const
Definition: IObject.h:104
virtual const PhysicalObject * getPhysicalObject() const
Definition: IObject.h:99
Definition: MMatrix3x3.h:32
ABCObject()
Definition: IObject.h:77
float float rot_[3]
Definition: ViewerApp.h:31
virtual void setHasRotChanged(bool val_)
Definition: IObject.h:85
float pos_[3]
Definition: ViewerApp.h:31
virtual ~Object()
Definition: IObject.h:39