-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgun.py
More file actions
31 lines (27 loc) · 811 Bytes
/
gun.py
File metadata and controls
31 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import json
from enum import Enum
class Gun:
def __init__(self, data):
self.shortname = data['shortname']
self.type = GunTypes[data['type']]
self.firemode = Firemodes[data['firemode']]
self.weight = data['weight']
self.rof = data['rof']
self.caliber = data['caliber']
self.fullname = data['fullname']
self.realname = data['realname']
self.desc = data['desc'] if data['desc'] is not None else ''
class GunTypes(Enum):
SHOTGUN = "Shotgun"
PISTOL = "Pistol"
SMG = "Submachine Gun"
AR = "Assault Rifle"
BR = "Battle Rifle"
LMG = "Light Machinegun"
SNIPER = "Sniper"
ATTACHMENT = "Attachment"
class Firemodes(Enum):
BOLT = "Pump/Bolt"
SEMI = "Semi-auto"
BURST = "Burst"
AUTO = "Full-auto"