Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rule<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus, Result, Error>

Rule of Diplomacy

Type parameters

  • Power

  • MilitaryBranch

  • State

  • UnitStatus

  • ProvinceStatus

  • Result

  • Error

Hierarchy

Index

Methods

Protected defaultOrderOf

  • defaultOrderOf(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>, unit: Unit<Power, MilitaryBranch>): Order<Power, MilitaryBranch> | null
  • Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>
    • unit: Unit<Power, MilitaryBranch>

    Returns Order<Power, MilitaryBranch> | null

    The default order of the unit. If there are no default order, it's null.

Protected errorOfOrder

  • errorOfOrder(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>, order: Order<Power, MilitaryBranch>): Error | null
  • Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>
    • order: Order<Power, MilitaryBranch>

    Returns Error | null

    The error message of the order. If the order is valid, it's null.

Protected errorOfOrders

  • errorOfOrders(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>, orders: Set<Order<Power, MilitaryBranch>>): Error | null
  • Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>
    • orders: Set<Order<Power, MilitaryBranch>>

    Returns Error | null

    The error message of the orders. If the set of the orders is valid, it's null.

resolve

  • resolve(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>, orders: Set<Order<Power, MilitaryBranch>>): ResultOrFail
  • Resolves orders and creates a result.

    Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>
    • orders: Set<Order<Power, MilitaryBranch>>

      The set of orders to be resolved.

    Returns ResultOrFail

    The result of the orders

Protected resolveProcedure

  • resolveProcedure(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>, orders: Set<Order<Power, MilitaryBranch>>): ResultOrFail
  • Resolve the orders, and creates result

    Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>
    • orders: Set<Order<Power, MilitaryBranch>>

    Returns ResultOrFail

    The result of the orders.

Protected unitsRequiringOrder

  • unitsRequiringOrder(board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>): Set<Unit<Power, MilitaryBranch>>
  • Parameters

    • board: Board<Power, MilitaryBranch, State, UnitStatus, ProvinceStatus>

    Returns Set<Unit<Power, MilitaryBranch>>

    The set of units that are requred orders.

Generated using TypeDoc