Move MovePlayerAction.Direction to geometry.Direction
This commit is contained in:
parent
010c67fd78
commit
e1044f3a73
3 changed files with 21 additions and 15 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import tcod
|
||||
from .actions import Action, ExitAction, MovePlayerAction, RegenerateRoomsAction
|
||||
from .geometry import Direction
|
||||
from typing import Optional
|
||||
|
||||
class EventHandler(tcod.event.EventDispatch[Action]):
|
||||
|
@ -15,13 +16,13 @@ class EventHandler(tcod.event.EventDispatch[Action]):
|
|||
sym = event.sym
|
||||
|
||||
if sym == tcod.event.KeySym.h:
|
||||
action = MovePlayerAction(MovePlayerAction.Direction.West)
|
||||
action = MovePlayerAction(Direction.West)
|
||||
elif sym == tcod.event.KeySym.j:
|
||||
action = MovePlayerAction(MovePlayerAction.Direction.South)
|
||||
action = MovePlayerAction(Direction.South)
|
||||
elif sym == tcod.event.KeySym.k:
|
||||
action = MovePlayerAction(MovePlayerAction.Direction.North)
|
||||
action = MovePlayerAction(Direction.North)
|
||||
elif sym == tcod.event.KeySym.l:
|
||||
action = MovePlayerAction(MovePlayerAction.Direction.East)
|
||||
action = MovePlayerAction(Direction.East)
|
||||
elif sym == tcod.event.KeySym.SPACE:
|
||||
action = RegenerateRoomsAction()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue