-
Notifications
You must be signed in to change notification settings - Fork 0
/
generic_client.py
51 lines (36 loc) · 1.24 KB
/
generic_client.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
46
47
48
49
50
51
from client.bala import HandlerBalas
from client.conexion import Conexion
from client.criaturas import HandlerCreatures
class GenericClient(object):
# set it to False in case you need to run the reactor elsewhere
STANDALONE = True
def __init__(self, host, equipo):
self.on = True
self.principal = None
self.loop = None
# handlers
self.balas = HandlerBalas(self)
self.hcriat = HandlerCreatures()
self.load_io_handlers()
self.conexion = Conexion(host, self, self.hcriat, equipo)
self.run_loop()
def run_loop(self):
raise NotImplementedError()
def load_io_handlers(self):
raise NotImplementedError()
def update(self):
raise NotImplementedError()
def activate_io_handlers(self):
raise NotImplementedError()
def create_map(self, sequence):
raise NotImplementedError()
def set_principal(self, player):
raise NotImplementedError()
def add_bullet(self, bullet):
self.balas.add_bullet(bullet)
def get_players(self):
return self.hcriat.get_players()
def get_bullets(self):
return self.balas.bullets
def get_score(self):
return self.hcriat.azul, self.hcriat.rojo