home · contact · privacy
Add basic multiplayer roguelike chat example.
[plomrogue2-experiments] / new2 / plomrogue / mapping.py
1 import collections
2
3
4
5 class YX(collections.namedtuple('YX', ('y', 'x'))):
6
7     def __add__(self, other):
8         return YX(self.y + other.y, self.x + other.x)
9
10     def __sub__(self, other):
11         return YX(self.y - other.y, self.x - other.x)
12
13     def __str__(self):
14         return 'Y:%s,X:%s' % (self.y, self.x)