Skip to content

Commit 967649e

Browse files
author
L'In20Cible
committed
Changed some wrapper enumerators to use enum.IntFlag instead of enum.IntEnum.
1 parent 4efc7ef commit 967649e

File tree

8 files changed

+22
-19
lines changed

8 files changed

+22
-19
lines changed

addons/source-python/packages/source-python/cvars/flags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# =============================================================================
88
# Python Imports
99
# Enum
10-
from enum import IntEnum
10+
from enum import IntFlag
1111

1212

1313
# =============================================================================
@@ -50,7 +50,7 @@
5050
# =============================================================================
5151
# >> ENUMERATORS
5252
# =============================================================================
53-
class ConVarFlags(IntEnum):
53+
class ConVarFlags(IntFlag):
5454
"""ConVar's flags wrapper enumerator."""
5555

5656
NONE = FCVAR_NONE

addons/source-python/packages/source-python/engines/trace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# =============================================================================
88
# Python Imports
99
# Enum
10-
from enum import IntEnum
10+
from enum import IntFlag
1111

1212
# Source.Python Imports
1313
# Entities
@@ -124,7 +124,7 @@
124124
# =============================================================================
125125
# >> ENUMERATORS
126126
# =============================================================================
127-
class ContentFlags(IntEnum):
127+
class ContentFlags(IntFlag):
128128
"""Content flags wrapper enumerator."""
129129

130130
EMPTY = CONTENTS_EMPTY
@@ -162,7 +162,7 @@ class ContentFlags(IntEnum):
162162
HITBOX = CONTENTS_HITBOX
163163

164164

165-
class ContentMasks(IntEnum):
165+
class ContentMasks(IntFlag):
166166
"""Content masks wrapper enumerator."""
167167

168168
ALL = MASK_ALL

addons/source-python/packages/source-python/entities/constants.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Python Imports
99
# Enum
1010
from enum import IntEnum
11+
from enum import IntFlag
1112

1213

1314
# =============================================================================
@@ -161,7 +162,7 @@
161162
# =============================================================================
162163
# >> ENUMERATORS
163164
# =============================================================================
164-
class DamageTypes(IntEnum):
165+
class DamageTypes(IntFlag):
165166
"""Damage types wrapper enumerator."""
166167

167168
GENERIC = DMG_GENERIC
@@ -199,7 +200,7 @@ class DamageTypes(IntEnum):
199200
HEADSHOT = DMG_HEADSHOT
200201

201202

202-
class EntityStates(IntEnum):
203+
class EntityStates(IntFlag):
203204
"""Entity state flags wrapper enumerator."""
204205

205206
FLY = FL_FLY
@@ -225,7 +226,7 @@ class EntityStates(IntEnum):
225226
UNBLOCKABLE_BY_PLAYER = FL_UNBLOCKABLE_BY_PLAYER
226227

227228

228-
class EntityEffects(IntEnum):
229+
class EntityEffects(IntFlag):
229230
"""Entity effects wrapper enumerator."""
230231

231232
BONEMERGE = EF_BONEMERGE
@@ -261,7 +262,7 @@ class TakeDamage(IntEnum):
261262
AIM = DAMAGE_AIM
262263

263264

264-
class EntityFlags(IntEnum):
265+
class EntityFlags(IntFlag):
265266
"""Entity flags wrapper enumerator."""
266267

267268
KILLME = EFL_KILLME

addons/source-python/packages/source-python/entities/datamaps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# =============================================================================
88
# Python Imports
99
# Enum
10-
from enum import IntEnum
10+
from enum import IntFlag
1111

1212
# Source.Python Imports
1313
# Memory
@@ -73,7 +73,7 @@
7373
# =============================================================================
7474
# >> ENUMERATORS
7575
# =============================================================================
76-
class TypeDescriptionFlags(IntEnum):
76+
class TypeDescriptionFlags(IntFlag):
7777
"""TypeDescription flags wrapper enumerator."""
7878

7979
GLOBAL = FTYPEDESC_GLOBAL

addons/source-python/packages/source-python/entities/props.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# =============================================================================
88
# Python Imports
99
# Enum
10-
from enum import IntEnum
10+
from enum import IntFlag
1111

1212

1313
# =============================================================================
@@ -53,7 +53,7 @@
5353
# =============================================================================
5454
# >> ENUMERATORS
5555
# =============================================================================
56-
class SendPropFlags(IntEnum):
56+
class SendPropFlags(IntFlag):
5757
"""SendProp flags wrapper enumerator."""
5858

5959
UNSIGNED = SPROP_UNSIGNED

addons/source-python/packages/source-python/players/constants.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Python Imports
99
# Enum
1010
from enum import IntEnum
11+
from enum import IntFlag
1112

1213

1314
# =============================================================================
@@ -106,7 +107,7 @@
106107
# =============================================================================
107108
# >> ENUMERATORS
108109
# =============================================================================
109-
class PlayerStates(IntEnum):
110+
class PlayerStates(IntFlag):
110111
"""Player states wrapper enumerator."""
111112

112113
ONGROUND = FL_ONGROUND
@@ -131,7 +132,7 @@ class LifeState(IntEnum):
131132
DISCARDBODY = LIFE_DISCARDBODY
132133

133134

134-
class PlayerButtons(IntEnum):
135+
class PlayerButtons(IntFlag):
135136
"""Player buttons wrapper enumerator."""
136137

137138
ATTACK = IN_ATTACK
@@ -162,7 +163,7 @@ class PlayerButtons(IntEnum):
162163
LOOKSPIN = IN_LOOKSPIN
163164

164165

165-
class HideHudFlags(IntEnum):
166+
class HideHudFlags(IntFlag):
166167
"""Hide hud flags wrapper enumerator."""
167168

168169
WEAPONSELECTION = HIDEHUD_WEAPONSELECTION

addons/source-python/packages/source-python/studio/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# =============================================================================
88
# Python Imports
99
# Enum
10-
from enum import IntEnum
10+
from enum import IntFlag
1111

1212

1313
# =============================================================================
@@ -48,7 +48,7 @@
4848
# =============================================================================
4949
# >> ENUMERATORS
5050
# =============================================================================
51-
class StudioFlags(IntEnum):
51+
class StudioFlags(IntFlag):
5252
"""Studio flags wrapper enumerator."""
5353

5454
NONE = STUDIO_NONE

addons/source-python/packages/source-python/weapons/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Python Imports
99
# Enum
1010
from enum import IntEnum
11+
from enum import IntFlag
1112

1213
# Source.Python Imports
1314
# Core
@@ -73,7 +74,7 @@
7374
# =============================================================================
7475
# >> ENUMERATORS
7576
# =============================================================================
76-
class ItemFlags(IntEnum):
77+
class ItemFlags(IntFlag):
7778
"""Item flags wrapper enumerator."""
7879

7980
SELECTONEMPTY = ITEM_FLAG_SELECTONEMPTY

0 commit comments

Comments
 (0)