-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
58 lines (43 loc) · 1.58 KB
/
main.py
File metadata and controls
58 lines (43 loc) · 1.58 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
from common.mysql import MysqlClient
from entities.event import Event
from entities.mission_type import MissionType
from services.planet_service import PlanetService
def processAttack(event: Event):
print("ATTACK:")
print(f"{event.startID} vs. {event.endID}")
def processTransport(event: Event):
if event.returning:
start_planet = PlanetService().get_planet_by_id(event.startID)
print(start_planet.name)
else:
start_planet = PlanetService().get_planet_by_id(event.startID)
print(start_planet.name)
print("TRANSPORT:")
def main():
mysql = MysqlClient()
event: Event = mysql.get_event(event_id)
mission_type = MissionType(event.mission)
if mission_type == MissionType.TRANSPORT:
print("Processing TRANSPORT")
processTransport(event)
elif mission_type == MissionType.DEPLOY:
print("Processing DEPLOY")
elif mission_type == MissionType.ATTACK:
print("Processing ATTACK")
processAttack(event)
elif mission_type == MissionType.ACS:
print("Processing ACS")
elif mission_type == MissionType.HOLD:
print("Processing HOLD")
elif mission_type == MissionType.COLONIZE:
print("Processing COLONIZE")
elif mission_type == MissionType.HARVEST:
print("Processing HARVEST")
elif mission_type == MissionType.ESPIONAGE:
print("Processing ESPIONAGE")
elif mission_type == MissionType.DESTROY:
print("Processing DESTROY")
else:
print(f"ERROR: MissionType {event.mission} invalid")
if __name__ == "__main__":
main()