Emergency 20 Dokumentation  4.2.0
Weapon.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 //[ Namespace ]
12 //[-------------------------------------------------------]
13 namespace em5
14 {
15  namespace weapon
16  {
17 
18 
19  //[-------------------------------------------------------]
20  //[ Public definitions ]
21  //[-------------------------------------------------------]
22  enum Weapon
23  {
36  };
37 
38  enum class Category
39  {
41  FIREARM,
42  THROWABLE,
43  UNKNOWN
44  };
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public functions ]
49  //[-------------------------------------------------------]
50  inline static Category getWeaponCategory(Weapon weapon)
51  {
52  switch (weapon)
53  {
54  case weapon::FIST:
56  case weapon::KNIFE:
58  case weapon::TORCH:
59  case weapon::SWORD:
61 
62  case weapon::PISTOL:
63  case weapon::RIFLE:
64  return Category::FIREARM;
65 
66  case weapon::STONE:
67  case weapon::MOLOTOV:
69  return Category::THROWABLE;
70  }
71  return Category::UNKNOWN;
72  }
73 
74 
75 //[-------------------------------------------------------]
76 //[ Namespace ]
77 //[-------------------------------------------------------]
78  } // weapon
79 } // em5
Definition: ActionPriority.h:13
Used by medieval units.
Definition: Weapon.h:32
Definition: Weapon.h:25
Definition: Weapon.h:27
Definition: Weapon.h:26
Definition: Weapon.h:29
Definition: Weapon.h:31
Only used by units.
Definition: Weapon.h:34
Category
Definition: Weapon.h:38
This is a special case to flag someone as not fighting or defending at all.
Definition: Weapon.h:24
Definition: Weapon.h:30
Weapon
Definition: Weapon.h:22
Definition: Weapon.h:28
Only used by units.
Definition: Weapon.h:35
Used by Guardsman in medieval maps.
Definition: Weapon.h:33