Table of Contents

Class UnitMoveHandler

Namespace
StarterKit
Assembly
StarterKit.dll

STARTERKIT - Handles unit movement mode for UnitInfoUI. Extracted to keep UnitInfoUI focused on display concerns.

public class UnitMoveHandler
Inheritance
object
UnitMoveHandler

Constructors

UnitMoveHandler(GameState, UnitSystem)

public UnitMoveHandler(GameState gameState, UnitSystem unitSystem)

Parameters

gameState GameState
unitSystem UnitSystem

Fields

OnMoveComplete

public Action OnMoveComplete

Field Value

Action

Properties

IsInMoveMode

public bool IsInMoveMode { get; }

Property Value

bool

Methods

ExitMoveMode()

Exit move mode without executing a move.

public void ExitMoveMode()

HandleProvinceClick(ushort)

Handle a province click while in move mode. Returns true if the click was handled (move executed or cancelled).

public bool HandleProvinceClick(ushort targetProvinceID)

Parameters

targetProvinceID ushort

Returns

bool

SetUIElements(Label, Button, Button, Button, Label)

Set UI element references for move mode display updates.

public void SetUIElements(Label header, Button createBtn, Button moveBtn, Button cancelBtn, Label moveLabel)

Parameters

header Label
createBtn Button
moveBtn Button
cancelBtn Button
moveLabel Label

TryEnterMoveMode(ushort)

Enter move mode for units in the specified province.

public bool TryEnterMoveMode(ushort sourceProvinceID)

Parameters

sourceProvinceID ushort

Returns

bool