-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathtypes.py
45 lines (32 loc) · 1.18 KB
/
types.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Type and PokeType class"""
import pokete_data as p_data
from .color import Color
class Types:
"""Class to organize PokeTypese"""
def __init__(self):
for i, typ in p_data.types.items():
setattr(self, i, PokeType(i, **typ))
for i in p_data.sub_types:
setattr(self, i, PokeSubType(i))
class PokeType:
"""Type for Poketes and attacks
ARGS:
name: The types name
effective: List of type names the type is effective against
ineffective: List of type names the type is ineffectice against
color: Color string"""
def __init__(self, name, effective, ineffective, color):
self.name = name
self.effective = effective
self.ineffective = ineffective
self.color = "" if color is None else "".join(getattr(Color, i)
for i in color)
class PokeSubType(PokeType):
"""Subtype class to better organize generic attacks
ARGS:
name: The types name"""
def __init__(self, name):
super().__init__(name, [], [], None)
types = Types()
if __name__ == "__main__":
print("\033[31;1mDo not execute this!\033[0m")