Steeriously  0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
InterposeComponent.hpp
1 #ifndef InterposeComponent_HPP
2 #define InterposeComponent_HPP
3 
4 #include <steeriously/Agent.hpp>
5 #include <steeriously/BehaviorData.hpp>
6 #include <steeriously/BehaviorHelpers.hpp>
7 #include <steeriously/Vector2.hpp>
8 
9 namespace steer
10 {
16  {
17  public:
19  virtual ~InterposeComponent();
20 
26  void setWeight(const float weight) { m_weightInterpose = weight; };
27 
32  float getWeight()const { return m_weightInterpose; };
33 
38  void setRotation(float r) { m_rotation = r; };
39 
44  float getRotation() { return m_rotation; };
45 
46  //pure virtual - must implement see Agent.hpp
47  virtual bool on(steer::behaviorType behavior){return (m_iFlags & behavior) == behavior;};
48 
49  void InterposeOn(){m_iFlags |= steer::behaviorType::interpose;};
50 
51  bool isInterposeOn(){return on(steer::behaviorType::interpose);};
52  void InterposeOff(){if(on(steer::behaviorType::interpose)) m_iFlags ^=steer::behaviorType::interpose;}
53 
54  void setAgents(steer::Agent* a, steer::Agent* b){m_agentA = a; m_agentB = b;};
55  void setAgentA(steer::Agent* a){m_agentA = a;};
56  void setAgentB(steer::Agent* b){m_agentB = b;};
57 
58  steer::Agent* getAgentA() const {return m_agentA;};
59  steer::Agent* getAgentB() const {return m_agentB;};
60 
61  //pure virtual - must implement see Agent.hpp
62  virtual Vector2 Calculate();
63 
64  void Update(float dt);
65 
66  private:
67  float m_weightInterpose;
68  Uint32 m_iFlags;
69  float m_rotation;
70  steer::Agent* m_agentA;
71  steer::Agent* m_agentB;
72  steer::BehaviorParameters* m_params;
73  };
74 }
75 
76 #endif // InterposeComponent_HPP