implement battleship

This commit is contained in:
Evan
2024-11-26 10:15:54 -08:00
parent 45e7170c2a
commit 8abc5e4aed
12 changed files with 304 additions and 25 deletions
+2
View File
@@ -31,6 +31,8 @@ export interface UnitInfo {
export enum UnitType {
TransportShip = "Transport",
Destroyer = "Destroyer",
Battleship = "Battleship",
Shell = "Shell",
Port = "Port",
AtomBomb = "Atom Bomb",
HydrogenBomb = "Hydrogen Bomb",
+5 -2
View File
@@ -357,7 +357,10 @@ export class PlayerImpl implements MutablePlayer {
case UnitType.Port:
return this.portSpawn(targetTile)
case UnitType.Destroyer:
return this.destroyerSpawn(targetTile)
case UnitType.Battleship:
return this.warshipSpawn(targetTile)
case UnitType.Shell:
return targetTile
case UnitType.MissileSilo:
return this.missileSiloSpawn(targetTile)
case UnitType.TransportShip:
@@ -387,7 +390,7 @@ export class PlayerImpl implements MutablePlayer {
return spawns[0]
}
destroyerSpawn(tile: Tile): Tile | false {
warshipSpawn(tile: Tile): Tile | false {
if (!tile.isOcean()) {
return false
}