#!/usr/bin/env python3.3

import curses
import Pyro4
from server import Game

hardcoded_fire = u"""
 (                     )                           )       (    (   (
 )\ )       *   )   ( /(         *   )    *   ) ( /(       )\ ) )\ ))\ )
(()/(   ( ` )  /(   )\())    ( ` )  /(  ` )  /( )\())(    (()/((()/(()/((
 /(_))  )\ ( )(_)) ((_)\     )\ ( )(_))  ( )(_)|(_)\ )\    /(_))/(_))(_))\\
(_)) _ ((_|_(_())    ((_) _ ((_|_(_())  (_(_()) _((_|(_)  (_))_(_))(_))((_)
| _ \ | | |_   _|   / _ \| | | |_   _|  |_   _|| || | __| | |_ |_ _| _ \ __|
|  _/ |_| | | |    | (_) | |_| | | |      | |  | __ | _|  | __| | ||   / _|
|_|  \___/  |_|     \___/ \___/  |_|      |_|  |_||_|___| |_|  |___|_|_\___|

You start in radom room. You have to find some items with ability to filling
with liquids, then find the source of fire, and PUT OUT THE FIRE.
"""

#print(hardcoded_fire)

class Mud:
    def __init__(self):
        print(hardcoded_fire)
        name = input("Type your name soldier: ").strip()
        self.game = Game()
        self.player = self.game.add_player(name)
        self.rooms = self.game.get_rooms()
        self.current_room = self.where_is()

    def where_is(self):
        return self.game.where_is(self.player)

    def get_room_object(self, room_name):
        for room in self.rooms:
            if room.name == room_name:
                return room

    @property
    def neighbors(self):
        return [self.rooms[index] for index in self.current_room.neighbors]

    def change_room(self, room_name):
        self.game.change_room(
            self.player,
            self.current_room,
            self.get_room_object(room_name)
            )
        self.current_room = self.where_is()

        print("You can go to:",
            ', '.join([room.name for room in self.neighbors]))



if __name__ == '__main__':
    Mud().change_room('kitchen')
@@ -1084,16 +1084,22 @@
 rooms = 
+tuple(
 self.gam
@@ -1111,16 +1111,17 @@
 _rooms()
+)
 %0A       
@@ -1152,24 +1152,55 @@
 f.where_is()
+%0A        self.max_capacity = 80
 %0A%0A    def wh
@@ -1269,29 +1269,24 @@
     def get_
-room_
 object(self,
@@ -1282,29 +1282,35 @@
 bject(self, 
-room_
+container, 
 name):%0A     
@@ -1320,26 +1320,25 @@
 for 
-roo
+ele
 m in 
-self.rooms
+container
 :%0A  
@@ -1350,19 +1350,19 @@
      if 
-roo
+ele
 m.name =
@@ -1363,21 +1363,16 @@
 name == 
-room_
 name:%0A  
@@ -1392,19 +1392,19 @@
  return 
-roo
+ele
 m%0A%0A    @
@@ -1664,20 +1664,27 @@
 get_
-room_
 object(
+self.rooms, 
 room
@@ -1748,16 +1748,62 @@
 re_is()%0A
+        print(self.current_room.describe_me())
 %0A       
@@ -1895,65 +1895,1066 @@
 ))%0A%0A
-%0A%0Aif __name__ == '__main__'
+    def take_item(self, item_name):%0A        item = self.current_room.get_item(item_name)%0A        if item is not None:%0A            print(item)%0A            if self.player.items_capacity() + item.capacity %3E self.max_capacity:%0A                print(%22Item is to big, if you really want it, drop some items%22)%0A                self.current_room.drop_item(item)%0A            else:%0A                self.player.take(item)%0A        else:%0A            print(%22There is no such an item%22)%0A%0A    def drop_item(self, item_name):%0A        item = self.get_object(self.player.items, item_name)%0A        self.player.drop(item)%0A        self.current_room.drop_item(item)%0A%0A%0Adef run_game()
 :%0A   
+ 
- Mud().change_room('kitchen'
+game = Mud()%0A    commands = %7B%0A        'go': game.change_room,%0A        'take': game.take_item,%0A        'drop': game.drop_item,%0A        'splash': None%0A        %7D%0A%0A    while True:%0A        cmd = input().strip().split(maxsplit=1)%0A        if cmd%5B0%5D in commands.keys():%0A            if len(cmd) == 1: commands%5Bcmd%5B0%5D%5D()%0A            else: commands%5Bcmd%5B0%5D%5D(cmd%5B1%5D)%0A%0A%0A%0A%0Aif __name__ == '__main__':%0A    run_game(
 )

NoneType is not iterable