Emergency 20 Dokumentation  4.2.0
ReserveLogic.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveLogic" game logic type ID
41 
43  {
44  STANDARD = 100,
45  LOW = 50,
46  MOVETO = 10,
47  NO_UNIT = 5
48  };
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public static methods ]
53  //[-------------------------------------------------------]
54  public:
59  template<typename T>
60  static void createReservation(qsf::Entity& targetEntity, uint64 reservationId);
61 
69  static bool checkReservation(qsf::Entity& targetEntity, uint64 reservationId, ReservePriority priority = ReservePriority::STANDARD);
70 
75  static void deleteOwnReservation(qsf::Entity& targetEntity, uint64 reservationId);
76 
81  static void deleteOwnReservation(const qsf::WeakPtr<qsf::Entity>& targetEntity, uint64 reservationId);
82 
87  static void deleteOwnReservation(qsf::Map& map, uint64 targetEntityId, uint64 reservationId);
88 
89  static void createReservationByTypeId(qsf::Entity& targetEntity, uint64 reservationId, uint32 typeId);
90 
91 
92  //[-------------------------------------------------------]
93  //[ Public methods ]
94  //[-------------------------------------------------------]
95  public:
96  explicit ReserveLogic(uint32 gamelogicTypeId);
97  uint64 getReservationId();
98  void setReservationId(uint64 reservationId);
99  void deleteLogic();
100 
101 
102  //[-------------------------------------------------------]
103  //[ Protected data ]
104  //[-------------------------------------------------------]
105  protected:
108 
109 
110  //[-------------------------------------------------------]
111  //[ CAMP reflection system ]
112  //[-------------------------------------------------------]
113  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
114 
115  };
116 
117 
123  {
124 
125  public:
126  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveParamedicLogic" game logic type ID
127 
128  public:
130 
131  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
132  };
133 
134 
140  {
141 
142  public:
143  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveDoctorLogic" game logic type ID
144 
145  public:
147 
148  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
149  };
150 
151 
157  {
158 
159  public:
160  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveCutRoadVehicleLogic" game logic type ID
161 
162  public:
164 
165  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
166  };
167 
168 
174  {
175 
176  public:
177  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveEnterVehicleLogic" game logic type ID
178 
179  public:
181 
182  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
183  };
184 
185 
191  {
192 
193  public:
194  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveGuidePersonLogic" game logic type ID
195 
196  public:
198 
199  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
200  };
201 
202 
208  {
209 
210  public:
211  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveDecontaminatePersonLogic" game logic type ID
212 
213  public:
215 
216  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
217  };
218 
219 
225  {
226 
227  public:
228  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveDivingSpotLogic" game logic type ID
229 
230  public:
232 
233  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
234  };
235 
236 
242  {
243 
244  public:
245  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveWaitForFinishLogic" game logic type ID
246 
247  public:
249 
250  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
251  };
252 
253 
259  {
260 
261  public:
262  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveDLKRescueLogic" game logic type ID
263 
264  public:
266 
267  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
268  };
269 
270 
276  {
277  public:
278  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveRescueDogLogic" game logic type ID
279 
280  public:
282 
283  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
284  };
285 
286 
292  {
293 
294  public:
295  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveGangsterLogic" game logic type ID
296 
297  public:
299 
300  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
301  };
302 
303 
309  {
310 
311  public:
312  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveArrestGangsterLogic" game logic type ID
313 
314  public:
316 
317  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
318  };
319 
325  {
326 
327  public:
328  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveCloseCombatLogic" game logic type ID
329 
330  public:
332 
333  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
334  };
335 
341  {
342 
343  public:
344  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveAttackedByGangsterLogic" game logic type ID
345 
346  public:
348 
349  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
350  };
351 
357  {
358 
359  public:
360  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReservePullingLogic" game logic type ID
361 
362  public:
364 
365  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
366  };
367 
368 
374  {
375 
376  public:
377  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveMoveToTargetLogic" game logic type ID
378 
379  public:
381 
382  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
383  };
384 
385 
391  {
392 
393  public:
394  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveRabidDogLogic" game logic type ID
395 
396  public:
398 
399  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
400  };
401 
402 
408  {
409 
410  public:
411  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveRepairOrUseLogic" game logic type ID
412 
413  public:
415 
416  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
417  };
418 
419 
425  {
426 
427  public:
428  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveCutTreeLogic" game logic type ID
429 
430  public:
432 
433  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
434  };
435 
436 
442  {
443 
444  public:
445  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveTowcarLogic" game logic type ID
446 
447  public:
449 
450  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
451  };
452 
453 
459  {
460 
461  public:
462  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReserveHeavyCraneLogic" game logic type ID
463 
464  public:
466 
467  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
468  };
469 
475  {
476 
477  public:
478  static const uint32 GAMELOGIC_TYPE_ID; // "em5::SpeakToPersonLogic" game logic type ID
479 
480  public:
482 
483  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
484  };
485 
491  {
492 
493  public:
494  static const uint32 GAMELOGIC_TYPE_ID; // "em5::RescueWitchLogic" game logic type ID
495 
496  public:
498 
499  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
500  };
501 
502 
503 //[-------------------------------------------------------]
504 //[ Namespace ]
505 //[-------------------------------------------------------]
506 } // em5
507 
508 
509 //[-------------------------------------------------------]
510 //[ CAMP reflection system ]
511 //[-------------------------------------------------------]
513 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveParamedicLogic)
514 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveDoctorLogic)
515 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveCutRoadVehicleLogic)
516 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveEnterVehicleLogic)
517 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveGuidePersonLogic)
518 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveDecontaminatePersonLogic)
519 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveDivingSpotLogic)
520 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveWaitForFinishLogic)
521 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveDLKRescueLogic)
522 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveRescueDogLogic)
523 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveGangsterLogic)
524 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveArrestGangsterLogic)
525 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveCloseCombatLogic)
526 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveAttackedByGangsterLogic)
527 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReservePullingLogic)
528 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveMoveToTargetLogic)
529 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveRabidDogLogic)
530 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveRepairOrUseLogic)
531 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveCutTreeLogic)
532 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveTowcarLogic)
533 QSF_CAMP_TYPE_NONCOPYABLE(em5::ReserveHeavyCraneLogic)
534 QSF_CAMP_TYPE_NONCOPYABLE(em5::SpeakToPersonLogic)
535 QSF_CAMP_TYPE_NONCOPYABLE(em5::RescueWitchLogic)
536 
537 
538 //[-------------------------------------------------------]
539 //[ Implementation ]
540 //[-------------------------------------------------------]
541 #include "em5/logic/local/ReserveLogic-inl.h"
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:211
Definition: ActionPriority.h:13
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:228
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:160
Reserve enter vehicle logic.
Definition: ReserveLogic.h:173
Reserve cars for the towcar logic.
Definition: ReserveLogic.h:441
Entity class.
Definition: Entity.h:46
Map class.
Definition: Map.h:93
uint64 mReservationId
ID of the entity who reserved this.
Definition: ReserveLogic.h:106
unsigned int uint32
Definition: PlatformTypes.h:181
Move to target logic.
Definition: ReserveLogic.h:373
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:126
Reserve logic.
Definition: ReserveLogic.h:32
Reserve speak to person logic.
Definition: ReserveLogic.h:474
#define EM5_API_EXPORT
Definition: Export.h:28
Reserve cut road vehicle logic.
Definition: ReserveLogic.h:156
Reserve decontaminate person logic.
Definition: ReserveLogic.h:207
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:344
Reserve doctor logic.
Definition: ReserveLogic.h:139
uint64_t uint64
Definition: PlatformTypes.h:184
ReservePriority mReservePriority
Definition: ReserveLogic.h:107
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:428
Reserve cars for the heavy crane logic.
Definition: ReserveLogic.h:458
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:278
Reserve attacked by gangster logic.
Definition: ReserveLogic.h:340
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:262
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:295
Reserve wait for finish.
Definition: ReserveLogic.h:241
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:478
Reserve dlk rescue logic.
Definition: ReserveLogic.h:258
Reserve rabid dog logic.
Definition: ReserveLogic.h:390
Reserve guide person logic.
Definition: ReserveLogic.h:190
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:194
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
ReservePriority
Definition: ReserveLogic.h:42
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:360
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:411
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:143
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:462
Reserve paramedic logic.
Definition: ReserveLogic.h:122
Game logic base class.
Definition: GameLogic.h:44
Reserve arrest gangster logic.
Definition: ReserveLogic.h:308
Reserve diving spot logic.
Definition: ReserveLogic.h:224
Reserve rescue dog logic.
Definition: ReserveLogic.h:275
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:40
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:394
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:177
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:312
Reserve pulling logic.
Definition: ReserveLogic.h:356
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:377
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:445
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:494
Reserve close combat logic.
Definition: ReserveLogic.h:324
Reserve repair or uselogic.
Definition: ReserveLogic.h:407
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:328
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReserveLogic.h:245
Reserve rescue witch logic.
Definition: ReserveLogic.h:490
Reserve gangster logic, mainly used for gangster fights.
Definition: ReserveLogic.h:291
Reserve Cuttree or hedge logic.
Definition: ReserveLogic.h:424