import { TObjectValues } from "../types"; import { CORE_CLASS, DOMAIN, FORMATION_CLASS, UNIT_MOVEMENT_CLASS } from "../constants"; import { BaseNode } from "./BaseNode"; export type TUnitNode = Pick; export class UnitNode extends BaseNode { unitType: `UNIT_${string}` | null = 'UNIT_TYPE'; baseMoves: number | null = 1; baseSightRange: number | null = 1; name: string | null = 'UNIT_NAME'; coreClass: TObjectValues | null = CORE_CLASS.MILITARY; domain: TObjectValues | null = DOMAIN.LAND; formationClass: TObjectValues | null = FORMATION_CLASS.LAND_COMBAT; unitMovementClass: TObjectValues | null = UNIT_MOVEMENT_CLASS.FOOT; airSlots: number | null = null; allowBarbarians: boolean | null = null; allowTeleportToOtherPlayerCapitals: boolean | null = null; antiAirCombat: number | null = null; buildCharges: number | null = null; canBeDamaged: boolean | null = null; canCapture: boolean | null = null; canEarnExperience: boolean | null = null; canPurchase: boolean | null = null; canRetreatWhenCaptured: boolean | null = null; canTargetAir: boolean | null = null; canTrain: boolean | null = null; canTriggerDiscovery: boolean | null = null; costProgressionModel: string | null = null; costProgressionParam1: number | null = null; description: string | null = null; enabledByReligion: boolean | null = null; evangelizeBelief: boolean | null = null; extractsArtifacts: boolean | null = null; foundCity: boolean | null = null; foundReligion: boolean | null = null; ignoreMoves: boolean | null = null; initialLevel: number | null = null; launchInquisition: boolean | null = null; maintenance: number | null = null; makeTradeRoute: boolean | null = null; mustPurchase: boolean | null = null; numRandomChoices: number | null = null; prereqPopulation: number | null = null; promotionClass: string | null = null; pseudoYieldType: string | null = null; purchaseYield: string | null = null; religionEvictPercent: number | null = null; religiousHealCharges: number | null = null; religiousStrength: number | null = null; requiresInquisition: boolean | null = null; spreadCharges: number | null = null; spy: boolean | null = null; stackable: boolean | null = null; strategicResource: string | null = null; teamVisibility: boolean | null = null; teleport: boolean | null = null; tier: number | null = null; trackReligion: boolean | null = null; traitType: string | null = null; victoryType: string | null = null; victoryUnit: boolean | null = null; wmdCapable: boolean | null = null; zoneOfControl: boolean | null = null; constructor(payload: Partial = {}) { super(); this.fill(payload); } }