return '/O O\\' + '| oo |' + '\\>--</'
return None
+ def remove_thing(self, t):
+ self.things.remove(t)
+ self.changed_fovs = True
+
+ def add_thing(self, type_, position, id_=0):
+ t_old = None
+ if id_ > 0:
+ t_old = self.get_thing(id_)
+ t = self.thing_types[type_](self, id_=id_, position=position)
+ if t_old:
+ self.things[self.things.index(t_old)] = t
+ else:
+ self.things += [t]
+ self.changed_fovs = True
+ return t
+
def send_gamestate(self, connection_id=None):
"""Send out game state data relevant to clients."""
t = self.get_player(connection_id)
if hasattr(t, 'name'):
self.io.send('CHAT ' + quote(t.name + ' left the map.'))
- self.things.remove(t)
- self.changed_fovs = True
+ self.remove_thing(t)
to_delete += [connection_id]
for connection_id in to_delete:
del self.sessions[connection_id]