Emergency 20 Dokumentation  4.2.0
AiAreaReservationFunctor.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace qsf
20 {
21  class Clock;
22  class MovableComponent;
23  namespace ai
24  {
25  class NavigationComponent;
26  }
27 }
28 
29 
30 //[-------------------------------------------------------]
31 //[ Namespace ]
32 //[-------------------------------------------------------]
33 namespace em5
34 {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Classes ]
39  //[-------------------------------------------------------]
54  {
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public methods ]
59  //[-------------------------------------------------------]
60  public:
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public virtual qsf::ai::ReservationConflictResolver methods ]
70  //[-------------------------------------------------------]
71  public:
72  virtual Result canInsertAfterResolve(const std::vector<ContainerType::const_iterator>& collisions, const qsf::ai::Reservation& reservation, const qsf::ai::AreaConfiguration& reservationId,
73  std::vector<bool>& deleteFlags, uint32 flags) override;
74 
75 
76  //[-------------------------------------------------------]
77  //[ Private static methods ]
78  //[-------------------------------------------------------]
79  private:
80  static bool areReservationsMutuallyExclusive(const qsf::ai::Reservation& lhs, const qsf::ai::Reservation& rhs, const qsf::MovableComponent& lhsMovable, const qsf::MovableComponent* rhsMovable, uint32 flags);
81 
82  // Higher means more critical here, should only return positive values from zero to +infinity
83  static float calculateCriticality(qsf::Time now, qsf::Time reservationBegin, const qsf::MovableComponent* movable, const qsf::ai::NavigationComponent& navi);
84  // Returns whether the reservation is for the area the entity is already inside
85  static bool isReservationForCurrentArea(const qsf::ai::NavigationComponent& navi, const qsf::ai::AreaConfiguration& reservation);
86  static bool isCar(uint32 moverType);
87  static bool isCivil(uint32 moverType);
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private data ]
92  //[-------------------------------------------------------]
93  private:
94  const qsf::Clock& mClock;
95 
96 
97  };
98 
99 
100 //[-------------------------------------------------------]
101 //[ Namespace ]
102 //[-------------------------------------------------------]
103 } // em5
Definition: ActionPriority.h:13
Definition: NavigationComponent.h:78
AI area reservation functor.
Definition: AiAreaReservationFunctor.h:53
Movable component base class.
Definition: MovableComponent.h:62
virtual Result canInsertAfterResolve(const std::vector< ContainerType::const_iterator > &collisions, const qsf::ai::Reservation &reservation, const qsf::ai::AreaConfiguration &reservationId, std::vector< bool > &deleteFlags, uint32 flags) override
unsigned int uint32
Definition: PlatformTypes.h:181
AiAreaReservationFunctor()
Default constructor.
This defines the interface for a functor that you need to provide in your specific implementation...
Definition: ReservationContainer.h:50
Clock class.
Definition: Clock.h:33
Definition: ReservationContainer.h:64
Definition: PickupPersonByParamedicAction.h:21
Definition: AreaConfiguration.h:23
Definition: Reservation.h:27
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32