YAPOG  0.0.1
Yet Another Pokemon Online Game
GridCollidableArea.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_GRIDCOLLIDABLEAREA_HPP
2 # define YAPOG_GRIDCOLLIDABLEAREA_HPP
3 
4 # include "YAPOG/Macros.hpp"
8 
9 namespace yap
10 {
11  class CollidableAreaCell;
12 
14  {
16 
17  public:
18 
20  virtual ~GridCollidableArea ();
21 
22  void SetSegmentCount (uint vSegmentCount, uint hSegmentCount);
23 
24  virtual bool CollidesWith (
25  const ICollidable& collidable,
26  const Vector2& offset,
27  const WorldObject& parent) const;
28 
29  virtual void GetEventsCollidingWith (
30  const ICollidable& collidable,
31  MapEventQueue& events,
32  DynamicWorldObject& parent) const;
33 
34  protected:
35 
36  virtual void HandleSetSize (const Vector2& size);
37 
38  virtual void HandleAddPhysicsCollidable (
39  ICollidable* collidable,
40  const MapCollidableInfo::PtrType& mapCollidableInfo);
41  virtual void HandleRemovePhysicsCollidable (ICollidable* collidable);
42 
43  virtual void HandleAddEventCollidable (
44  ICollidable* collidable,
45  const MapEventInfo::PtrType& mapEventInfo);
46  virtual void HandleRemoveEventCollidable (ICollidable* collidable);
47 
48  private:
49 
50  void GetCollidableRectangle (
51  const ICollidable& collidable,
52  UIntRect& rectangle) const;
53  void GetCollidableRectangle (
54  const ICollidable& collidable,
55  const Vector2& offset,
56  UIntRect& rectangle) const;
57 
58  static const uint MIN_VSEGMENT_COUNT;
59  static const uint MIN_HSEGMENT_COUNT;
60 
63 
65 
67  };
68 } // namespace yap
69 
70 #endif // YAPOG_GRIDCOLLIDABLEAREA_HPP