home · contact · privacy
Add toilets, and terrain type tags.
[plomrogue2] / plomrogue / misc.py
1 class Terrain:
2
3     def __init__(self, character, description, blocks_light=False,
4                  blocks_sound=False, blocks_movement=False):
5         self.character = character
6         self.description = description
7         self.blocks_light = blocks_light
8         self.blocks_sound = blocks_sound
9         self.blocks_movement = blocks_movement
10         self.tags = set()
11
12
13
14 def quote(string):
15     """Quote & escape string so client interprets it as single token."""
16     quoted = []
17     quoted += ['"']
18     for c in string:
19         if c in {'"', '\\'}:
20             quoted += ['\\']
21         quoted += [c]
22     quoted += ['"']
23     return ''.join(quoted)