예제 #1
0
파일: map.py 프로젝트: lppl/hexmap
 def __init__(self, center=(0, 0), size=9, orientation=orientation):
     point_guard(center)
     self.center = center
     self.size = size
     self.orientation = orientation
     self.directions = {}
     for i, d in enumerate(orientation):
         self.directions[d] = i
예제 #2
0
파일: map.py 프로젝트: lppl/hexmap
 def __map_point_guard(self, p):
     point_guard(p)
     if not in_distance(self.center, p, self.size - 1):
         raise PointOutsideOfMapException(
             "Point %s exists outside of map center: %s, size: %s" % (p, self.center, self.size)
         )
예제 #3
0
파일: map.py 프로젝트: lppl/hexmap
 def go_to(self, p):
     point_guard(p)
     self.p = p
     return self
예제 #4
0
파일: map.py 프로젝트: lppl/hexmap
 def __init__(self, p):
     point_guard(p)
     self.p = p