public KeyboardMovement(ICharacter character, IInput input, KeyboardMovementMode mode) { _character = character; Enabled = true; Mode = mode; _up = new AGSConcurrentHashSet<Key> (); _down = new AGSConcurrentHashSet<Key> (); _left = new AGSConcurrentHashSet<Key> (); _right = new AGSConcurrentHashSet<Key> (); _keysDown = new AGSConcurrentHashSet<Key> (); input.KeyDown.SubscribeToAsync(onKeyDown); input.KeyUp.SubscribeToAsync(onKeyUp); }
public KeyboardMovement(ICharacter character, IInput input, IFocusedUI focusedUi, KeyboardMovementMode mode) { _character = character; _focusedUi = focusedUi; Enabled = true; Mode = mode; _up = new AGSConcurrentHashSet <Key> (); _down = new AGSConcurrentHashSet <Key> (); _left = new AGSConcurrentHashSet <Key> (); _right = new AGSConcurrentHashSet <Key> (); _keysDown = new AGSConcurrentHashSet <Key> (); input.KeyDown.SubscribeToAsync(onKeyDown); input.KeyUp.SubscribeToAsync(onKeyUp); }