示例#1
0
 def list_inventory(self):
     if len(self.inventory.items) > 0:
         r = Success("You are carrying:")
         for item_id in self.inventory.items:
             item = self.vocab.lookup_noun(item_id)
             r.append("\n\t" + item.description)
     else:
         r = Success("You're not carrying anything")
     return r
示例#2
0
 def history(self):
     r = Success("Recent command history: \n")
     if len(self.command_history) > 0:
         for c in self.command_history:
             r.append("\n|" + self.prompt + c.input_text)
     else:
         r.append("(no commands yet entered)")
     r.append("\n")
     return r
示例#3
0
 def help(self):
     r = Success("Available commands are: \n")
     r.append(', '.join(self.vocabulary.get_valid_verbs()))
     return r