Skip to content

ObjectComponentMove Class

Moves a IScreenObject with the arrow keys.

C#
public class ObjectComponentMove : KeyboardConsoleComponent, IComponent

Inheritance objectKeyboardConsoleComponent

Implements IComponent

Creates a new instance of the object with an Amount of 1.

C#
public ObjectComponentMove()

The amount to move the object by.

C#
public int Amount { get; set; }

The key to move the object SadRogue.Primitives.Direction.Left by Amount.

C#
public Keys LeftKey { get; set; }

The key to move the object SadRogue.Primitives.Direction.Right by Amount.

C#
public Keys RightKey { get; set; }

The key to move the object SadRogue.Primitives.Direction.Up by Amount.

C#
public Keys UpKey { get; set; }

The key to move the object SadRogue.Primitives.Direction.Down by Amount.

C#
public Keys DownKey { get; set; }

ProcessKeyboard(IScreenObject, Keyboard, out bool)

Section titled “ProcessKeyboard(IScreenObject, Keyboard, out bool)”

Moves the host by Amount when the appropriate key is pressed.

C#
public override void ProcessKeyboard(IScreenObject host, Keyboard keyboard, out bool handled)

host IScreenObject

keyboard Keyboard

handled bool