Exemplo n.º 1
0
def message_to_object(msg):
    code = msg.get_command()
    if code == M_WALL_UPDATE:
        obj = WallData()
    elif code == M_NPC_UPDATE:
        obj = NPCData()
    elif code == M_MISSILE_UPDATE:
        obj = MissileData()
    elif code == M_PLAYER_UPDATE:
        obj = PlayerData()
    else:
        obj = None
    if obj:
        obj.set_from_message(msg)
    return obj
Exemplo n.º 2
0
def message_to_object(msg):
    code = msg.get_command()
    if code == M_WALL_UPDATE:
        obj = WallData()
    elif code == M_NPC_UPDATE:
        obj = NPCData()
    elif code == M_MISSILE_UPDATE:
        obj = MissileData()
    elif code == M_PLAYER_UPDATE:
        obj = PlayerData()
    else:
        obj = None
    if obj:
        obj.set_from_message(msg)
    return obj
Exemplo n.º 3
0
 def get_wall(self):
     wall = WallData()
     wall.set_from_message(self)
     return wall
Exemplo n.º 4
0
 def get_wall(self):
     wall = WallData()
     wall.set_from_message(self)
     return wall