|
|
@ -4,20 +4,27 @@ Python class for DF_Hack::Position
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
from ._pydfhack import _PositionManager
|
|
|
|
from ._pydfhack import _PositionManager
|
|
|
|
from .blocks import Point, Block
|
|
|
|
from .blocks import Point, Block
|
|
|
|
class Position(_PositionManager):
|
|
|
|
from .mixins import NoStart
|
|
|
|
|
|
|
|
from .decorators import suspend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Position(NoStart, _PositionManager):
|
|
|
|
api = None
|
|
|
|
api = None
|
|
|
|
|
|
|
|
cls = _PositionManager
|
|
|
|
def __init__(self, api, *args, **kwds):
|
|
|
|
def __init__(self, api, *args, **kwds):
|
|
|
|
_PositionManager.__init__(self, args, kwds)
|
|
|
|
self.cls.__init__(self, args, kwds)
|
|
|
|
self.api = api
|
|
|
|
self.api = api
|
|
|
|
|
|
|
|
|
|
|
|
def prepare(self):
|
|
|
|
@suspend
|
|
|
|
"""
|
|
|
|
|
|
|
|
Enforce Suspend/Start
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
return self.api.prepare()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_cursor(self):
|
|
|
|
def get_cursor(self):
|
|
|
|
self.prepare()
|
|
|
|
|
|
|
|
coords = self.cursor_coords
|
|
|
|
coords = self.cursor_coords
|
|
|
|
return Point(*coords)
|
|
|
|
return Point(*coords)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@suspend
|
|
|
|
|
|
|
|
def get_window_size(self):
|
|
|
|
|
|
|
|
wsize = self.window_size
|
|
|
|
|
|
|
|
return wsize
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@suspend
|
|
|
|
|
|
|
|
def get_view_coords(self):
|
|
|
|
|
|
|
|
coords = self.view_coords
|
|
|
|
|
|
|
|
return Point(*coords)
|
|
|
|