import { graph } from "./graph"; export declare namespace board { /** * Name of atomic components (e.g., provinces) */ class Name { name: string; abbreviatedName: string; /** * @param name The name * @param abbreviatedName The abbreviated name. name is used if this param is not specified. */ constructor(name: string, abbreviatedName?: string); toString(): string; } /** * Province in Diplomacy map */ class Province { name: Name; homeOf: Power | null; isSupplyCenter: boolean; /** * @param name The name of this province * @param homeOf * The power that has this province as a home country. * This is a neutral province if null is set. * @param isSupplyCenter The flag whether this is a supply center or not. */ constructor(name: Name, homeOf: Power | null, isSupplyCenter?: boolean); toString(): string; } /** * Location in Diplomacy map. Each province is expected to have 1 location at least. */ class Location { name: Name; province: Province; /** * The set of military branches that can enter this location. */ militaryBranches: Set; /** * @param name The name of this location. It is usually same as the name of the province * @param province The province that this location is in. * @param militaryBranches The set of military branches that can enter this location. */ constructor(name: Name, province: Province, militaryBranches: Set | Array); toString(): string; } /** * Unit of Diplomacy */ class Unit { militaryBranch: MilitaryBranch; location: Location; power: Power; /** * @param militaryBranch The military branch of this unit. * @param location The location where this unit is in. * @param power The power that has this unit. */ constructor(militaryBranch: MilitaryBranch, location: Location, power: Power); toString(): string; } /** * Relation between board.Location */ class MapEdge extends graph.LabeledEdge, Set> { /** * @param n1 The end point 1. * @param n2 The end point 2. * @param label The set of military branches. */ constructor(n1: Location, n2: Location, militaryBranches: Set | Array); } /** * Map of Diplomacy */ class DiplomacyMap { private map; /** * The set of locations in this map */ locations: Set>; /** * The set of provinces in this map */ provinces: Set>; /** * The set of powers in this map */ powers: Set; private provinceToLocation; /** * @param map The labeled graph that represents the map. */ constructor(map: graph.LabeledUndirectedGraph, Set>); /** * @param province The province * @return The set of locations that the province has. */ locationsOf(province: Province): Set>; /** * @param province The province * @param militaryBranch The military branch * @return The set of provinces that the military branch in the province can move. */ movableProvincesOf(province: Province, militaryBranch: MilitaryBranch): Set>; /** * @param {!board.Location} location - The location * @param {!(string|Object)} militaryBranch - The military branch * @return {!Set.} - * The set of locations that the military branch in the location can move. */ movableLocationsOf(location: Location, militaryBranch: MilitaryBranch): Set>; } class Board { map: DiplomacyMap; state: State; /** * The units that are in this board */ units: Set>; /** * The state of each unit (e.g., the unit was dislodged) */ unitStatuses: Map, UnitStatus>; /** * The state of each province (e.g., standoff was occurred, this province is occupied by X) */ provinceStatuses: Map, ProvinceStatus>; /** * @param map * @param state * @param units The units that are in this board * @param unitStatuses The state of each unit (e.g., the unit was dislodged) * @param provinceStatuses * The state of each province (e.g., standoff was occurred, this province is occupied by X) */ constructor(map: DiplomacyMap, state: State, units: Set> | Array>, unitStatuses: Map, UnitStatus> | Array<[Unit, UnitStatus]>, provinceStatuses: Map, ProvinceStatus> | Array<[Province, ProvinceStatus]>); } }