home · contact · privacy
Add multi-class thing type system.
[plomrogue2-experiments] / new / example_client.py
index 7a9902708a60cf36140ae2024fd1e9c21cbb00d6..039d8de6bc134f9835c4f70a130a3a4879fb7890 100755 (executable)
@@ -3,10 +3,11 @@ import curses
 import socket
 import threading
 from plomrogue.parser import ArgError, Parser
-from plomrogue.commands import cmd_MAP, cmd_THING_TYPE, cmd_THING_POS
-from plomrogue.game import Game, WorldBase, ThingBase
+from plomrogue.commands import cmd_MAP, cmd_THING_POS
+from plomrogue.game import Game, WorldBase
 from plomrogue.mapping import MapBase
 from plomrogue.io import PlomSocket
+from plomrogue.things import ThingBase
 import types
 
 
@@ -104,6 +105,11 @@ def cmd_GAME_STATE_COMPLETE(self):
     self.to_update['turn'] = True
     self.to_update['map'] = True
 
+def cmd_THING_TYPE(game, i, type_):
+    t = game.world.get_thing(i)
+    t.type_ = type_
+cmd_THING_TYPE.argtypes = 'int:nonneg string'
+
 
 class Game: