def message(self): s = 'Which do you mean, ' l = [] for word in self.words: l.append(word.word.definite) s += utils.naturalJoin(l, ', ', ' or ') s += '?' return s
def inv(self, output): '''Write object inventory on output. output : output''' l = [] for item in self.inventory: if props.Mobile in item.props: l.append(item.Normal.getDesc('inv')) if len(l) == 0: l.append('nothing') output.write(self.responses[self.INVENTORY] % utils.naturalJoin(l, ', ', ' and ')) output.close()
def exitString(self): s = self.responses[self.SEE_EXITS] % utils.naturalJoin( self.exits.keys(), ', ', ' and ') return s