This commit is contained in:
Jocelyn Fiat
2024-06-17 09:09:33 +02:00
commit 6dde6425c2
560 changed files with 81728 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
note
description: "[
Class incapsulating the nationalities in VITP and responsible
for the creation of those attributes.
These attributes are used as pseudo-constants. I elected
not to use once features becasue the order of calls to
once featues may not work for persistence.
]"
author: "Jimmy J. Johnson"
date: "$Date$"
revision: "$Revision$"
class
NATIONALITY_CONSTANTS
feature -- Access
nobody: INTEGER_32 = -2
-- Not sure if this is useful ?
either: INTEGER_32 = -1
-- Used in SOP when either player can make a choice
japanese: INTEGER_32 = 0
-- Default, because Japanese always moves first
us: INTEGER_32 = 1
-- United States
british: INTEGER_32 = 2
-- An allied nationality
dutch: INTEGER_32 = 3
-- An allied nationality
australian: INTEGER_32 = 4
-- An allied nationality
allied: INTEGER_32 = 5
-- Catch-all for `us', `british', `dutch', and `australian'
feature -- Query
is_allied_nationality (a_nationality: like japanese): BOOLEAN
-- Is `a_nationality' one of the allies?
do
Result := a_nationality >= us
end
end

View File

@@ -0,0 +1,69 @@
note
description: "[
Class incapsulating each {LOCATION} in VITP that is not a
{SEA_AREA} or {PORT} but needed by the game and responsible for
the creation of those attributes. Decomposed into this class
so that {VITP_GAME} would not be such a large file.
These attributes are used as pseudo-constants. I elected
not to use once features becasue the order of calls to
once featues may not work for persistence.
]"
author: "Jimmy J. Johnson"
date: "$Date$"
revision: "$Revision$"
deferred class
OTHER_ATTRIBUTES
inherit
ANY
redefine
default_create
end
feature {NONE} -- Initialization
default_create
-- Initialize all port attributes
do
-- create still_in_box.make (game)
-- create Allied_starting_chart.make (game)
-- create Allied_oa_chart.make (game)
-- create Japanese_oa_chart.make (game)
-- create Uncertain.make (game)
-- create Uncommitted_japanese_location.make (game)
-- create Uncommitted_allied_location.make (game)
-- create Asia.make (game)
-- create Kamchatka.make (game)
-- create Aleutians.make (game)
-- create Solomans.make (game)
-- create Marshalls_north.make (game)
-- create Marshalls_south.make (game)
end
feature -- Access
game: VITP_GAME
-- The game in which this item belongs.
deferred
end
feature -- Access
still_in_box: STILL_IN_BOX attribute create Result.make (game) end
allied_starting_forces_chart: ALLIED_STARTING_FORCES_CHART attribute create Result.make (game) end
allied_oa_chart: ALLIED_ORDER_OF_APPEARANCE_CHART attribute create Result.make (game) end
japanese_oa_chart: JAPANESE_ORDER_OF_APPEARANCE_CHART attribute create Result.make (game) end
uncertain: LOCATION_UNCERTAIN attribute create Result.make (game) end
uncommitted_japanese_location: JAPANESE_UNCOMMITTED_LOCATION attribute create Result.make (game) end
uncommitted_allied_location: ALLIED_UNCOMMITTED_LOCATION attribute create Result.make (game) end
-- Asia: ASIA attribute create Result.make (game) end
-- Kamchatka: KAMCHATKA attribute create Result.make (game) end
-- Aleutians: ALEUTIANS attribute create Result.make (game) end
-- Solomans: SOLOMANS attribute create Result.make (game) end
-- Marshalls_north: MARSHALLS_NORTH attribute create Result.make (game) end
-- Marshalls_south: MARSHALLS_SOUTH attribute create Result.make (game) end
end

View File

@@ -0,0 +1,146 @@
note
description: "[
Class incapsulating each {PORT} in VITP and responsible for
the creation of those attributes. Decomposed into this class
so that {VITP_GAME} would not be such a large file.
These attributes are used as pseudo-constants. I elected
not to use once features becasue the order of calls to
once featues may not work for persistence.
]"
author: "Jimmy J. Johnson"
date: "$Date$"
revision: "$Revision$"
deferred class
PORT_ATTRIBUTES
feature -- Access
game: VITP_GAME
-- The game in which this item belongs.
deferred
end
default_port: DEFAULT_PORT attribute create Result.make (game) end
-- A {PORT} for use where no other applies.
feature -- Access (major ports)
australia: AUSTRALIA attribute create Result.make (game) end
ceylon: CEYLON attribute create Result.make (game) end
pearl_harbor: PEARL_HARBOR attribute create Result.make (game) end
saigon: SAIGON attribute create Result.make (game) end
samoa: SAMOA attribute create Result.make (game) end
singapore: SINGAPORE attribute create Result.make (game) end
truk: TRUK attribute create Result.make (game) end
yokosuka_navy_yard: YOKOSUKA_NAVY_YARD attribute create Result.make (game) end
feature -- Access (minor ports)
andaman_islands: ANDAMAN_ISLANDS attribute create Result.make (game) end
attu: ATTU attribute create Result.make (game) end
dutch_harbor: DUTCH_HARBOR attribute create Result.make (game) end
johnston_island: JOHNSTON_ISLAND attribute create Result.make (game) end
guadalcanal: GUADALCANAL attribute create Result.make (game) end
kwajalein: KWAJALEIN attribute create Result.make (game) end
lae: LAE attribute create Result.make (game) end
maloelap: MALOELAP attribute create Result.make (game) end
midway: MIDWAY attribute create Result.make (game) end
new_hebrides: NEW_HEBRIDES attribute create Result.make (game) end
okinawa: OKINAWA attribute create Result.make (game) end
philippines: PHILIPPINES attribute create Result.make (game) end
port_moresby: PORT_MORESBY attribute create Result.make (game) end
saipan: SAIPAN attribute create Result.make (game) end
feature -- Access (port groups)
ports: VITP_TABLE [PORT]
-- Convenience feature containing all the major (red) pots on the board
attribute
create Result.make (major_ports.count + minor_ports.count)
Result.merge (major_ports)
Result.merge (minor_ports)
end
major_ports: VITP_TABLE [RED_PORT]
-- Convenience feature containing all the major (red) pots on the board
attribute
create Result.make (8)
Result.extend (Australia, Australia.name)
Result.extend (Ceylon, Ceylon.name)
Result.extend (Pearl_harbor, Pearl_harbor.name)
Result.extend (Saigon, Saigon.name)
Result.extend (Samoa, Samoa.name)
Result.extend (Singapore, Singapore.name)
Result.extend (Truk, Truk.name)
Result.extend (Yokosuka_navy_yard, Yokosuka_navy_yard.name)
end
minor_ports: VITP_TABLE [GREEN_PORT]
-- Convenience feature containing all the minor (green) ports on the board
attribute
create Result.make (14)
Result.extend (Andaman_islands, Andaman_islands.name)
Result.extend (Attu, Attu.name)
Result.extend (Dutch_harbor, Dutch_harbor.name)
Result.extend (Johnston_island, Johnston_island.name)
Result.extend (Guadalcanal, Guadalcanal.name)
Result.extend (Kwajalein, Kwajalein.name)
Result.extend (Lae, Lae.name)
Result.extend (Maloelap, Maloelap.name)
Result.extend (Midway, Midway.name)
Result.extend (New_hebrides, New_hebrides.name)
Result.extend (Okinawa, Okinawa.name)
Result.extend (Philippines, Philippines.name)
Result.extend (Port_moresby, Port_moresby.name)
Result.extend (Saipan, Saipan.name)
end
island_ports: VITP_TABLE [PORT]
-- Convenience feature containig all the island ports
attribute
create Result.make (15)
Result.extend (Andaman_islands, Andaman_islands.name)
Result.extend (Attu, Attu.name)
Result.extend (Ceylon, Ceylon.name)
Result.extend (Dutch_harbor, Dutch_harbor.name)
Result.extend (Johnston_island, Johnston_island.name)
Result.extend (Guadalcanal, Guadalcanal.name)
Result.extend (Kwajalein, Kwajalein.name)
Result.extend (Maloelap, Maloelap.name)
Result.extend (Midway, Midway.name)
Result.extend (New_hebrides, New_hebrides.name)
Result.extend (Okinawa, Okinawa.name)
Result.extend (Pearl_harbor, Pearl_harbor.name)
Result.extend (Saipan, Saipan.name)
Result.extend (Samoa, Samoa.name)
Result.extend (Truk, Truk.name)
end
feature -- Query
friendly_ports (a_nationality: like {NATIONALITY_CONSTANTS}.japanese): VITP_TABLE [PORT]
-- All ports and island bases controlled by `a_nationality'
local
p: PORT
do
create Result.make (ports.count)
from ports.start
until ports.after
loop
p := ports.item_for_iteration
if p.nationality = a_nationality then
Result.extend (p, p.name)
end
ports.forth
end
end
invariant
port_count_correct: ports.count = 22
major_port_count_correct: major_ports.count = 8
minor_port_count_correct: minor_ports.count = 14
island_port_count_correct: island_ports.count = 15
end

View File

@@ -0,0 +1,79 @@
note
description: "[
Class incapsulating each {SEA_AREA} in VITP and responsible for
the creation of those attributes. Decomposed into this class
so that {VITP_GAME} would not be such a large file.
These attributes are used as pseudo-constants. I elected
not to use once features becasue the order of calls to
once featues may not work for persistence.
]"
author: "Jimmy J. Johnson"
date: "$Date$"
revision: "$Revision$"
deferred class
SEA_AREA_ATTRIBUTES
feature -- Access
game: VITP_GAME
-- The game in which this item belongs.
deferred
end
feature -- Access (sea areas)
Aleutian_islands: ALEUTIAN_ISLANDS attribute create Result.make (game) end
Bay_of_bengal: BAY_OF_BENGAL attribute create Result.make (game) end
Central_pacific_ocean: CENTRAL_PACIFIC_OCEAN attribute create Result.make (game) end
Coral_Sea: CORAL_SEA attribute create Result.make (game) end
Hawaiian_islands: HAWAIIAN_ISLANDS attribute create Result.make (game) end
Indian_ocean: INDIAN_OCEAN attribute create Result.make (game) end
Indonesia: INDONESIA attribute create Result.make (game) end
Japanese_islands: JAPANESE_ISLANDS attribute create Result.make (game) end
Marianas_islands: MARIANAS_ISLANDS attribute create Result.make (game) end
Marshall_islands: MARSHALL_ISLANDS attribute create Result.make (game) end
North_pacific_ocean: NORTH_PACIFIC_OCEAN attribute create Result.make (game) end
South_pacific_ocean: SOUTH_PACIFIC_OCEAN attribute create Result.make (game) end
US_mandate: US_MANDATE attribute create Result.make (game) end
feature -- Access (groups)
sea_areas: VITP_TABLE [SEA_AREA]
-- Convenience feature containing all the sea areas on the board
attribute
create Result.make (13)
Result.extend (Aleutian_islands, Aleutian_islands.name)
Result.extend (Bay_of_bengal, Bay_of_bengal.name)
Result.extend (Central_pacific_ocean, Central_pacific_ocean.name)
Result.extend (Coral_sea, Coral_sea.name)
Result.extend (Hawaiian_islands, Hawaiian_islands.name)
Result.extend (Indian_ocean, Indian_ocean.name)
Result.extend (Indonesia, Indonesia.name)
Result.extend (Japanese_islands, Japanese_islands.name)
Result.extend (Marianas_islands, Marianas_islands.name)
Result.extend (Marshall_islands, Marshall_islands.name)
Result.extend (North_pacific_ocean, North_pacific_ocean.name)
Result.extend (South_pacific_ocean, South_pacific_ocean.name)
Result.extend (US_mandate, US_mandate.name)
end
contested_areas: LINKED_SET [SEA_AREA]
-- Sea areas that contain both Japanese and Allied units
local
s: SEA_AREA
do
create Result.make
from Sea_areas.start
until Sea_areas.after
loop
s := Sea_areas.item_for_iteration
if s.is_contested then
Result.extend (s)
end
Sea_areas.forth
end
end
end

View File

@@ -0,0 +1,27 @@
note
description: "[
Abstraction for the brown land in VITP
]"
author: "Jimmy J. Johnson"
deferred class
LAND
inherit
LOCATION
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,337 @@
note
description: "[
Root class for all the locations (ports, sea-areas, bases) in VITP.
]"
author: "Jimmy J. Johnson"
deferred class
LOCATION
inherit
VITP_ITEM
redefine
make
end
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
-- create defining_position
create units_imp.make
is_stable := True
-- defining_cell := game.
end
feature -- Access
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
deferred
end
defining_cell: VITP_CELL
-- The "central" cell for Current, around which its
-- positioning `grid' is built.
local
x, y: INTEGER_32
once
x := ((defining_position.x + game.board_left) / game.cell_size).truncated_to_integer + 1
y := ((defining_position.y + game.board_top) / game.cell_size).truncated_to_integer + 1
Result := game.cell (x, y)
end
units: LINKED_SET [like unit_anchor]
-- Copy of the list of units in current.
-- Why do I have this feature?
do
print ("LOCATION.units: why have this feature? %N");
Result := units_imp.twin
end
japanese_units: LINKED_SET [like unit_anchor]
-- All the japanese units in Current
do
create Result.make
from units_imp.start
until units_imp.exhausted
loop
if units_imp.item.nationality = game.Japanese then
Result.extend (units_imp.item)
end
units_imp.forth
end
end
allied_units: LINKED_SET [like unit_anchor]
-- All the allied units in Current
do
create Result.make
from units_imp.start
until units_imp.exhausted
loop
if units_imp.item.nationality /= game.Japanese then
Result.extend (units_imp.item)
end
units_imp.forth
end
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
deferred
end
feature -- Status report
is_port: BOOLEAN
-- Is the location a {PORT}?
do
Result := Current.conforms_to ({PORT})
end
is_sea_area: BOOLEAN
-- Is the location a {SEA_AREA}?
do
Result := Current.conforms_to ({SEA_AREA})
end
feature -- Basic operations
put (a_unit: like unit_anchor)
-- Ensure `a_unit' is in Current
require
unit_exists: a_unit /= Void
-- valid_move: a_unit.is_valid_move (Current)
do
is_stable := False
units_imp.put (a_unit)
if a_unit.location /= Current then
a_unit.set_location (Current)
end
is_stable := True
ensure
has_unit: has (a_unit)
location_integrity: a_unit.location = Current
end
prune (a_unit: like unit_anchor)
-- Ensure `a_unit' is NOT in Current
require
unit_exists: a_unit /= Void
do
is_stable := False
if has (a_unit) then
units_imp.prune (a_unit)
end
is_stable := True
ensure
not_has_unit: not has (a_unit)
end
feature -- Query
-- friendly_ports (a_nationality: NATIONALITY): LINKED_SET [PORT]
-- -- Of the `adjoining_ports' the ones that are friendly to `a_nationality'
-- local
-- p: like adjoining_ports
-- do
-- create Result.make
-- from ports.start
-- until ports.exhausted
-- loop
-- if not ports.item.is_enemy_controlled (a_nationality) then
-- Result.extend (ports.item)
-- end
-- ports.forth
-- end
-- end
distance_to (other: LOCATION): INTEGER
-- The distance between Current and `other'
do
io.put_string ("LOCATION.distance_to: Fix me - move functionality to VITP_GAME? %N")
Result := {INTEGER_32}.max_value
end
is_enemy_controlled (a_nationality: like game.japanese): BOOLEAN
-- Is the location controlled by the other side?
do
Result := (game.is_allied_nationality (a_nationality) and not game.is_allied_nationality (nationality)) or
(not game.is_allied_nationality (a_nationality) and game.is_allied_nationality (nationality))
end
has (a_unit: like unit_anchor): BOOLEAN
-- Does Current contain `a_unit'?
require
unit_exists: a_unit /= Void
do
Result := units_imp.has (a_unit)
end
has_allied: BOOLEAN
-- Does this location have any allied game piece here?
local
u: like unit_anchor
do
from units_imp.start
until Result or else units_imp.after
loop
u := units_imp.item
Result := game.is_allied_nationality (u.nationality)
units_imp.forth
end
end
has_japanese: BOOLEAN
-- Does this location have any japanese game piece here?
local
u: like unit_anchor
do
from units_imp.start
until Result or else units_imp.after
loop
u := units_imp.item
Result := not game.is_allied_nationality (u.nationality)
units_imp.forth
end
end
has_japanese_patroller: BOOLEAN
-- Does this location contain at least one Japanese patroller?
local
u: like unit_anchor
do
from units_imp.start
until Result or else units_imp.after
loop
u := units_imp.item
Result := u.is_patrolling and then
not game.is_allied_nationality (u.nationality)
units_imp.forth
end
end
has_allied_patroller: BOOLEAN
-- Does this location contain at least one Japanese patroller?
local
u: like unit_anchor
do
from units_imp.start
until Result or else units_imp.after
loop
u := units_imp.item
Result := u.is_patrolling and then
game.is_allied_nationality (u.nationality)
units_imp.forth
end
end
has_japanese_air_raiders: BOOLEAN
-- Does Current contain any Japanese carriers?
-- (Carriers are the only units that can air raid.)
local
set: like japanese_units
do
set := japanese_units
from set.start
until set.exhausted or Result
loop
Result := attached {SHIP} set.item as s and then s.airstrike_factor > 0
set.forth
end
end
has_allied_air_raiders: BOOLEAN
-- Does Current contain any Japanese carriers?
-- (Carriers are the only units that can air raid.)
local
set: like allied_units
do
set := allied_units
from set.start
until set.exhausted or Result
loop
Result := attached {SHIP} set.item as s and then s.airstrike_factor > 0
set.forth
end
end
has_allied_amphibious: BOOLEAN
-- Does Current contain any Allied amphibious units?
local
set: like allied_units
do
set := allied_units
from set.start
until set.exhausted or Result
loop
Result := attached {AMPHIBIOUS_UNIT} set.item
set.forth
end
end
has_japanese_amphibious: BOOLEAN
-- Does Current contain any Japanese amphibious units?
local
set: like japanese_units
do
set := japanese_units
from set.start
until set.exhausted or Result
loop
Result := attached {AMPHIBIOUS_UNIT} set.item
set.forth
end
end
feature {NONE} -- Implementation
units_imp: LINKED_SET [like unit_anchor]
-- The units that are in this location
has_invalid_unit: BOOLEAN
-- Does Current contain a unit that does not refer back to Current?
-- For invariant checking
-- Should always be false
require
call_only_when_stable: is_stable
do
from units_imp.start
until Result or units_imp.exhausted
loop
Result := units_imp.item.location /= Current
units_imp.forth
end
end
is_stable: BOOLEAN
-- Set to false when pruning and adding units for invariant checking
-- of referential integrity between units and locations
feature {NONE} -- Anchors (for covariant redefinitions)
unit_anchor: ATTACK_UNIT
-- Anchor for features using units.
-- Not to be called; just used to anchor types.
-- Declared as a feature to avoid adding an attribute.
require
not_callable: False
do
check
do_not_call: False then
-- Because give no info; simply used as anchor.
end
end
invariant
valid_controller: nationality = game.japanese or nationality = game.us or nationality = game.nobody
all_units_imp_refer_to_current: is_stable implies not has_invalid_unit
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
ALEUTIANS
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Aleutians"
-- This name of this item.
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Describes this chart as a location, so units can be moved to it.
]"
author: "Jimmy J. Johnson"
class
ALLIED_ORDER_OF_APPEARANCE_CHART
inherit
LOCATION
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Allied Order of Appearance Chart"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Describes this chart as a location, so units can be moved to it.
]"
author: "Jimmy J. Johnson"
class
ALLIED_STARTING_FORCES_CHART
inherit
LOCATION
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Allied Starting Forces Chart"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,39 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
ALLIED_UNCOMMITTED_LOCATION
inherit
LOCATION_UNCOMMITTED
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Allied uncommited location"
-- The name of this unit.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
ASIA
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Asia"
-- This name of this item.
end

View File

@@ -0,0 +1,53 @@
note
description: "[
Represents the Order of Appearance chart for VITP.
The attack units begin the game here and enter during play.
]"
author: "Jimmy J. Johnson"
class
JAPANESE_ORDER_OF_APPEARANCE_CHART
inherit
LOCATION
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Japanese Order of Appearance Chart"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,39 @@
note
description: "Summary description for {JAPANESE_UNCOMMITED_POSITION}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
JAPANESE_UNCOMMITTED_LOCATION
inherit
LOCATION_UNCOMMITTED
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {LOCATION_UNCOMMITTED} (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Akagi"
-- The name of this unit.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
KAMCHATKA
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Kamchatka"
-- This name of this item.
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Describes this chart as a location, so units can be moved to it.
]"
author: "Jimmy J. Johnson"
class
LOCATION_UNCERTAIN
inherit
LOCATION
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := game.nobody
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Location Uncertain"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,39 @@
note
description: "[
Describes this location, so units can be moved to it.
]"
author: "Jimmy J. Johnson"
deferred class
LOCATION_UNCOMMITTED
inherit
LOCATION
redefine
make
end
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.nobody
end
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
MARSHALLS_NORTH
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Marshalls North"
-- This name of this item.
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
MARSHALLS_SOUTH
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Marshalls South"
-- This name of this item.
end

View File

@@ -0,0 +1,22 @@
note
description: "[
Describes this particular {LAND} area.
]"
author: "Jimmy J. Johnson"
class
SOLOMANS
inherit
LAND
create
make
feature -- Access
name: STRING_8 = "Solomans"
-- This name of this item.
end

View File

@@ -0,0 +1,54 @@
note
description: "[
Describes this chart as a location, so units can be moved to it.
]"
author: "Jimmy J. Johnson"
date: "$Date: 2012-07-01 01:25:45 -0400 (Sun, 01 Jul 2012) $"
revision: "$Revision: 31 $"
class
STILL_IN_BOX
inherit
LOCATION
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.nobody
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Still in Box"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature {NONE} -- Inapplicable
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
do
-- satisfy void safety
Result := (create {LINKED_SET [SEA_AREA]}.make).linear_representation
check
do_not_call: False
-- Because not applicable
end
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
ANDAMAN_ISLANDS
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [20, 220]
end
feature -- Access
name: STRING_8 = "Andaman Islands"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.bay_of_bengal)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
ATTU
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [540, 30]
end
feature -- Access
name: STRING_8 = "Attu"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.aleutian_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,50 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
LAE
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [310, 380]
end
feature -- Access
name: STRING_8 = "Lae"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indonesia)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,63 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
PEARL_HARBOR
inherit
REPAIR_PORT
undefine
distance_to
redefine
make
end
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor {REPAIR_PORT} (a_game)
Precursor {RED_PORT} (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [670, 320]
end
feature -- Access
name: STRING_8 = "Pearl Harbor"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER
-- Number of repair points for the player
do
Result := ((game.sequence_of_play.turn - 1) * 3).min (15)
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.hawaiian_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
SAIGON
inherit
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [130, 230]
end
feature -- Access
name: STRING_8 = "Saigon"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER = 0
-- Number of repair points for the player
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indonesia)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,65 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
SAMOA
inherit
REPAIR_PORT
undefine
distance_to
redefine
make
end
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor {REPAIR_PORT} (a_game)
Precursor {RED_PORT} (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [590, 510]
end
feature -- Access
name: STRING_8 = "Samoa"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER
-- Number of repair points for the player
do
if is_allied and game.pearl_harbor.is_japanese then
Result := ((game.sequence_of_play.turn - 1) * 3).min (15)
end
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
SINGAPORE
inherit
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [90, 280]
end
feature -- Access
name: STRING_8 = "Singapore"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER = 0
-- Number of repair points for the player
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indonesia)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,54 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
TRUK
inherit
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [390, 310]
end
feature -- Access
name: STRING_8 = "Truk"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER = 0
-- Number of repair points for the player
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.marianas_islands)
s.extend (game.marshall_islands)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,80 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
AUSTRALIA
inherit
REPAIR_PORT
undefine
distance_to
redefine
make
end
RED_PORT
redefine
make,
distance_to
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor {REPAIR_PORT} (a_game)
Precursor {RED_PORT} (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [300, 470]
end
feature -- Access
name: STRING_8 = "Australia"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER
-- Number of repair points
do
if is_allied then
Result := 1
end
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.indian_ocean)
Result := s.linear_representation
end
distance_to (other: LOCATION): INTEGER
-- The distance between Current and `other'
do
io.put_string (generating_type.name + ".distance_to: fix me %N")
-- if game.phase = game.movement_phase then
-- if other = game.indian_ocean or other = game.coral_sea then
-- Result := 1
-- end
-- else
-- Result := Precursor {RED_PORT} (other)
-- end
end
end

View File

@@ -0,0 +1,65 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
CEYLON
inherit
REPAIR_PORT
undefine
distance_to
redefine
make
end
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor {REPAIR_PORT} (a_game)
Precursor {RED_PORT} (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [20, 180]
end
feature -- Access
name: STRING_8 = "Ceylon"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER
-- Number of repair points
do
if is_allied then
Result := 1
end
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.bay_of_bengal)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,50 @@
note
description: "[
{PORT} to be used as place holder when a unit is not in the game.
]"
author: "Jimmy J. Johnson"
class
DEFAULT_PORT
inherit
PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.nobody
defining_position := [0, 0]
end
feature -- Access
name: STRING_8 = "Default Port"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
feature -- Access
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
DUTCH_HARBOR
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [670, 70]
end
feature -- Access
name: STRING_8 = "Dutch Harbor"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.aleutian_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,14 @@
note
description: "[
A {PORT} in VITP that does not have repair capabilities.
]"
author: "Jimmy J. Johnson"
deferred class
GREEN_PORT
inherit
PORT
end

View File

@@ -0,0 +1,50 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
GUADALCANAL
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [400, 450]
end
feature -- Access
name: STRING_8 = "Guadalcanal"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
JOHNSTON_ISLAND
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [640, 370]
end
feature -- Access
name: STRING_8 = "Johnston Island"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.hawaiian_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
KWAJALEIN
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [470, 350]
end
feature -- Access
name: STRING_8 = "Kwajalein"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.marshall_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
MALOELAP
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [530, 350]
end
feature -- Access
name: STRING_8 = "Maloelap"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.marshall_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
MIDWAY
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [560, 220]
end
feature -- Access
name: STRING_8 = "Midway"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.central_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,50 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
NEW_HEBRIDES
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [450, 510]
end
feature -- Access
name: STRING_8 = "New Hebrides"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
OKINAWA
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [290, 180]
end
feature -- Access
name: STRING_8 = "Okinawa"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.japanese_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,50 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
PHILIPPINES
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [220, 260]
end
feature -- Access
name: STRING_8 = "Philippines"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indonesia)
s.extend (game.marianas_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,17 @@
note
description: "Any port in VITP."
author: "Jimmy J. Johnson"
deferred class
PORT
inherit
LOCATION
feature -- Access
feature -- Status report
end

View File

@@ -0,0 +1,50 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
PORT_MORESBY
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [300, 400]
end
feature -- Access
name: STRING_8 = "Port Moresby"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.indian_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,31 @@
note
description: "[
A "major" port {VITP_GAME}.
]"
author: "Jimmy J. Johnson"
deferred class
RED_PORT
inherit
PORT
redefine
distance_to
end
feature -- Access
distance_to (other: LOCATION): INTEGER
-- The distance between Current and `other'
do
-- if vitp.phase = {GAME_SEQUENCE}.returning_to_base and then
-- vitp.major_ports.has (other.name) and
-- not other.is_enemy_controlled (nationality) then
-- Result := 0
-- else
-- Result := Precursor (other)
-- end
end
end

View File

@@ -0,0 +1,58 @@
note
description: "[
A {PORT} in {VITP_GAME} which [possibly] has repair capability.
]"
author: "Jimmy J. Johnson"
date: "11/11/23"
copyright: "Copyright (c) 2021, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
deferred class
REPAIR_PORT
inherit
PORT
redefine
make
end
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
create dry_dock.make (0)
end
feature -- Access
repair_points: INTEGER
-- Number of repair points available at this port
deferred
end
repair_points_used: INTEGER
-- Total repair points assigned to ships
do
from dry_dock.start
until dry_dock.after
loop
Result := Result + dry_dock.item.points
dry_dock.forth
end
end
feature {NONE} -- Implementation
dry_dock: ARRAYED_LIST [TUPLE [ship: SHIP; points: INTEGER]]
-- Contains the ships to be repaired along with the repair
-- points assigned to that ship on this turn.
invariant
repair_points_not_exceeded: repair_points_used <= repair_points
end

View File

@@ -0,0 +1,49 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
SAIPAN
inherit
GREEN_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [380, 260]
end
feature -- Access
name: STRING_8 = "Saipan"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.marianas_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,65 @@
note
description: "[
Describes this particular port
]"
author: "Jimmy J. Johnson"
class
YOKOSUKA_NAVY_YARD
inherit
REPAIR_PORT
undefine
distance_to
redefine
make
end
RED_PORT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Set up Current
do
Precursor {REPAIR_PORT} (a_game)
Precursor {RED_PORT} (a_game)
nationality := {NATIONALITY_CONSTANTS}.Japanese
defining_position := [300, 130]
end
feature -- Access
name: STRING_8 = "Yokosuka Navy Yard"
-- This name of this item.
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
repair_points: INTEGER
-- Number of repair points for the player
do
if is_japanese then
Result := 6
end
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- A list of all sea areas that touch this location
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.japanese_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,70 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
ALEUTIAN_ISLANDS
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.nobody
defining_position := [570, 80]
end
feature -- Access
name: STRING_8 = "Aleutian Islands"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 0
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 1
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.attu)
p.extend (game.dutch_harbor)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.japanese_islands)
s.extend (game.central_pacific_ocean)
s.extend (game.north_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,69 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
BAY_OF_BENGAL
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [30, 330]
end
feature -- Access
name: STRING_8 = "Bay of Bengal"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.ceylon)
p.extend (game.andaman_islands)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indonesia)
s.extend (game.indian_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,72 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
CENTRAL_PACIFIC_OCEAN
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [540, 180]
end
feature -- Access
name: STRING_8 = "Central Pacific Ocean"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 0
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 1
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.midway)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.aleutian_islands)
s.extend (game.hawaiian_islands)
s.extend (game.japanese_islands)
s.extend (game.marianas_islands)
s.extend (game.marshall_islands)
s.extend (game.north_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,72 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
CORAL_SEA
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [380, 510]
end
feature -- Access
name: STRING_8 = "Coral Sea"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 2
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.australia)
p.extend (game.port_moresby)
p.extend (game.guadalcanal)
p.extend (game.new_hebrides)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.indian_ocean)
s.extend (game.south_pacific_ocean)
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,71 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
HAWAIIAN_ISLANDS
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [660, 400]
end
feature -- Access
name: STRING_8 = "Hawaiian Islands"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 3
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.johnston_island)
p.extend (game.pearl_harbor)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.central_pacific_ocean)
s.extend (game.marshall_islands)
s.extend (game.north_pacific_ocean)
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,70 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
INDIAN_OCEAN
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [70, 440]
end
feature -- Access
name: STRING_8 = "Indian Ocean"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 0
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.australia)
p.extend (game.port_moresby)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.bay_of_bengal)
s.extend (game.indonesia)
s.extend (game.coral_sea)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,74 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
INDONESIA
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [150, 300]
end
feature -- Access
name: STRING_8 = "Indonesia"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 3
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.saigon)
p.extend (game.singapore)
p.extend (game.philippines)
p.extend (game.lae)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.bay_of_bengal)
s.extend (game.indonesia)
s.extend (game.japanese_islands)
s.extend (game.marshall_islands)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,71 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
JAPANESE_ISLANDS
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [420, 110]
end
feature -- Access
name: STRING_8 = "Japanese Islands"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 3
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 3
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.yokosuka_navy_yard)
p.extend (game.okinawa)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.aleutian_islands)
s.extend (game.central_pacific_ocean)
s.extend (game.marianas_islands)
s.extend (game.indonesia)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,73 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
MARIANAS_ISLANDS
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [310, 250]
end
feature -- Access
name: STRING_8 = "Marianas Islands"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.philippines)
p.extend (game.saipan)
p.extend (game.truk)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.central_pacific_ocean)
s.extend (game.indonesia)
s.extend (game.japanese_islands)
s.extend (game.marshall_islands)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,73 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
MARSHALL_ISLANDS
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.japanese
defining_position := [490, 320]
end
feature -- Access
name: STRING_8 = "Marshall Islands"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 1
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.kwajalein)
p.extend (game.maloelap)
p.extend (game.truk)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.central_pacific_ocean)
s.extend (game.hawaiian_islands)
s.extend (game.marianas_islands)
s.extend (game.south_pacific_ocean)
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,69 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
NORTH_PACIFIC_OCEAN
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.nobody
defining_position := [670, 150]
end
feature -- Access
name: STRING_8 = "North Pacific Ocean"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 1
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.dutch_harbor)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.aleutian_islands)
s.extend (game.central_pacific_ocean)
s.extend (game.hawaiian_islands)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,52 @@
note
description: "[
Represents a sea area for the VITP game.
]"
author: "Jimmy J. Johnson"
deferred class
SEA_AREA
inherit
LOCATION
feature -- Access
POC: INTEGER
-- The number of points awarded at end of turn to player
-- that controls this area.
do
if is_japanese then
Result := japanese_poc
else
Result := allied_poc
end
end
japanese_poc: INTEGER
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
deferred
end
allied_poc: INTEGER
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
deferred
end
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
deferred
end
feature -- Status report
is_contested: BOOLEAN
-- Does Current contain Japanese and Allied units?
do
Result := japanese_units.count > 0 and allied_units.count > 0
end
end

View File

@@ -0,0 +1,73 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
SOUTH_PACIFIC_OCEAN
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [390, 390]
end
feature -- Access
name: STRING_8 = "South Pacific Ocean"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 1
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.guadalcanal)
p.extend (game.lae)
p.extend (game.truk)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.indonesia)
s.extend (game.marianas_islands)
s.extend (game.marshall_islands)
s.extend (game.us_mandate)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,71 @@
note
description: "[
Describes this particular location in VITP
]"
author: "Jimmy J. Johnson"
class
US_MANDATE
inherit
SEA_AREA
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize Current
do
Precursor (a_game)
nationality := {NATIONALITY_CONSTANTS}.us
defining_position := [570, 460]
end
feature -- Access
name: STRING_8 = "US Mandate"
-- The displayed name for this widget
defining_position: TUPLE [x, y: INTEGER_32]
-- The x- and y-coordinate (in millimeters) of Current's
-- position relative to the top-left corner of the board.
allied_poc: INTEGER = 2
-- The number of points gained by the Allied player if he
-- controls this area at the end of a turn
japanese_poc: INTEGER = 2
-- The number of points gained by the Japanese player if he
-- controls this area at the end of a turn
adjoining_ports: LINEAR [PORT]
-- All the ports that adjoin this sea area
local
p: LINKED_SET [PORT]
once
create p.make
p.extend (game.new_hebrides)
p.extend (game.samoa)
Result := p.linear_representation
end
adjacent_sea_areas: LINEAR [SEA_AREA]
-- All the sea areas which touch this one
local
s: LINKED_SET [SEA_AREA]
once
create s.make
s.extend (game.coral_sea)
s.extend (game.hawaiian_islands)
s.extend (game.marshall_islands)
s.extend (game.south_pacific_ocean)
Result := s.linear_representation
end
end

View File

@@ -0,0 +1,151 @@
note
description: "[
Represents one of the air force attack units in VITP.
]"
author: "Jimmy J. Johnson"
deferred class
AIR_UNIT
inherit
ATTACK_UNIT
redefine
patrol_distance,
raid_distance,
arrival_location
-- arrival_position
end
feature -- Access
patrol_distance: INTEGER = 1000
-- How may sea areas can Current move through as patroller?
-- Just set to a very large number.
raid_distance: INTEGER = 1000
-- How may sea areas can Current move through as raider?
-- Just set to a very large number.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
if is_returning_unit then
if nationality = game.japanese then
Result := game.uncommitted_japanese_location
else
Result := game.uncommitted_allied_location
end
else
Result := Precursor
end
end
-- arrival_position: like position
-- -- The location (latitude/longitude-like coordinates) where Current
-- -- will enter the game
-- local
-- sop: VITP_SEQUENCE_OF_PLAY
-- do
-- sop := game.sequence_of_play
-- if nationality = game.japanese then
-- Result := [250, 50]
-- else
-- if sop.turn = 1 and Current = game.eleventh_af then
-- Result := [700, 300]
-- elseif sop.turn = 1 and Current = game.fifth_af then
-- Result := [130, 320]
-- else
-- Result := [700, 560]
-- end
-- end
-- end
feature -- Status report
is_sunk: BOOLEAN
-- Has the unit been sunk this turn?
do
Result := damage >= defense_factor
end
is_patrollable: BOOLEAN = True
-- Can this unit be a patroller for area control purposes?
is_raidable: BOOLEAN = False
-- Can this unit be a raider?
is_patrolling: BOOLEAN = False
-- Is this unit a patroller (as opposed to a raider)?
-- Air units a `is_patrollable' but don't move as patrollers.
is_raiding: BOOLEAN = False
-- Is this unit a raider?
feature -- Basic operations
return_to_port (a_port: PORT)
require
-- is_return_allowed: is_at_sea and then a_port.controller = nationality and then
-- (location.adjoins (a_port) or else a_port.is_major)
do
location := a_port
end
repair
-- Do repairs on the ship
require
-- is_in_port: location.is_port
port_has_repair_capability:
do
end
-- join_force (a_other: ATTACK_UNIT)
-- -- Join forces with `a_other' as a single `task_force'
-- do
-- check
-- do_not_call: false then
-- -- Because inapplicable to {AIR_UNIT}
-- end
-- end
-- leave_force
-- -- Remove Current from the `task_force' to which it belongs, but only
-- -- if there are other ships in the force, and put it in its own.
-- do
-- check
-- do_not_call: false then
-- -- Because inapplicable to {AIR_UNIT}
-- end
-- end
feature -- Query
is_incompatible_position (a_position: VITP_POSITION): BOOLEAN
-- Is `a_position' located on a unit with which Current is NOT
-- allowed to `join_force' (e.g. on a submarine or an enemy)?
local
u_list: VITP_TABLE [ATTACK_UNIT]
au: ATTACK_UNIT
do
if not is_in_game then
Result := false
else
u_list := game.all_attack_units
from u_list.start
until u_list.after or else Result
loop
au := u_list.item_for_iteration
Result := au.contains_position (a_position)
u_list.forth
end
end
-- Temp for testing
Result := false
end
feature {NONE} -- Implementaion
end

View File

@@ -0,0 +1,27 @@
note
description: "[
An {AIR_UNIT} belonging to the Allied player in VITP
]"
author: "Jimmy J. Johnson"
date: "3/15/24"
copyright: "Copyright (c) 2021, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
deferred class
ALLIED_AIR_UNIT
inherit
ALLIED_UNIT
undefine
patrol_distance,
raid_distance,
arrival_location
end
AIR_UNIT
undefine
make
end
end

View File

@@ -0,0 +1,35 @@
note
description: "[
An {SHIP} that belongs to the Allies.
]"
author: "Jimmy J. Johnson"
date: "5/12/24"
copyright: "Copyright (c) 2024, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
deferred class
ALLIED_SHIP
inherit
ALLIED_UNIT
undefine
reinforceable_ports,
internal_is_movable,
is_bottomed
end
SHIP
undefine
make -- make from {ALLIED_UNIT} calls {SHIP}.make
-- reinforceable_ports
end
invariant
is_allied: nationality = {NATIONALITY_CONSTANTS}.us or
nationality = {NATIONALITY_CONSTANTS}.british or
nationality = {NATIONALITY_CONSTANTS}.australian or
nationality = {NATIONALITY_CONSTANTS}.dutch
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
ELEVENTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "11th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 2
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,68 @@
note
description: "[
Represents the corresponding air unit in game.
]"
author: "Jimmy J. Johnson"
class
FIFTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make,
arrival_location,
arrival_port
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
arrival_location := a_game.indonesia
arrival_port := a_game.singapore
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "5th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
FOURTEENTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "14th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 5
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINE
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "Marine"
-- The name of this unit.
arrival_turn: INTEGER = 4
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
NAVAL
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "Naval"
-- The name of this unit.
arrival_turn: INTEGER = 5
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
RAAF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "RAAF"
-- The name of this unit.
arrival_turn: INTEGER = 3
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
RNZAF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "RNZAF."
-- The name of this unit.
arrival_turn: INTEGER = 3
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,68 @@
note
description: "[
Represents the corresponding air unit in game.
]"
author: "Jimmy J. Johnson"
class
SEVENTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make,
arrival_location,
arrival_port
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
arrival_location := a_game.pearl_harbor
arrival_port := a_game.pearl_harbor
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "7th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
TENTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "10th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 2
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,57 @@
note
description: "[
Represents the corresponding air unit in VITP.
]"
author: "Jimmy J. Johnson"
class
THIRTEENTH_AF
inherit
ALLIED_AIR_UNIT
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_game: like game)
-- Initialize attributes of Current
do
PRECURSOR {ALLIED_AIR_UNIT} (a_game)
nationality := game.us
home_port := arrival_port
end
feature -- Access
name: STRING_8 = "13th A.F."
-- The name of this unit.
arrival_turn: INTEGER = 4
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 2
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 9
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding amphibious unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINES_1
inherit
ALLIED_AMPHIBIOUS_UNIT
create
make
feature -- Access
name: STRING_8 = "1 Marines"
-- The name of this unit.
arrival_turn: INTEGER = 3
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding amphibious unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINES_2
inherit
ALLIED_AMPHIBIOUS_UNIT
create
make
feature -- Access
name: STRING_8 = "2 Marines"
-- The name of this unit.
arrival_turn: INTEGER = 3
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding amphibious unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINES_3
inherit
ALLIED_AMPHIBIOUS_UNIT
create
make
feature -- Access
name: STRING_8 = "3 Marines"
-- The name of this unit.
arrival_turn: INTEGER = 5
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding amphibious unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINES_4
inherit
ALLIED_AMPHIBIOUS_UNIT
create
make
feature -- Access
name: STRING_8 = "4 Marines"
-- The name of this unit.
arrival_turn: INTEGER = 6
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding amphibious unit in VITP.
]"
author: "Jimmy J. Johnson"
class
MARINES_5
inherit
ALLIED_AMPHIBIOUS_UNIT
create
make
feature -- Access
name: STRING_8 = "5 Marines"
-- The name of this unit.
arrival_turn: INTEGER = 8
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
ARIZONA
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Arizona"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 4
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
ASTORIA
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Astoria"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
AUSTRALIA_SHIP
inherit
AUSTRALIAN_SHIP
create
make
feature -- Access
name: STRING_8 = "Australia"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
CALIFORNIA
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "California"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 4
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 5
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
CANBERRA
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Canberra"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
CHESTER
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Chester"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
CHICAGO
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Chicago"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,62 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
DE_RUYTER
inherit
DUTCH_SHIP
redefine
arrival_location,
arrival_port
end
create
make
feature -- Access
name: STRING_8 = "De Ruyter"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.singapore
end
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
do
Result := game.singapore
end
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
ENTERPRISE
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Enterprise"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 4
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 2
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = True
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,62 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
EXETER
inherit
BRITISH_SHIP
redefine
arrival_location,
arrival_port
end
create
make
feature -- Access
name: STRING_8 = "Exeter"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.singapore
end
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
do
Result := game.singapore
end
end

View File

@@ -0,0 +1,53 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
HERMES
inherit
BRITISH_SHIP
redefine
arrival_location
end
create
make
feature -- Access
name: STRING_8 = "Hermes"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 1
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 2
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 4
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.bay_of_bengal
end
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
HORNET
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Hornet"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 4
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 0
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 2
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = True
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,61 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
HOUSTON
inherit
US_SHIP
redefine
arrival_location,
arrival_port
end
create
make
feature -- Access
name: STRING_8 = "Houston"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.philippines
end
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
do
Result := game.philippines
end
end

View File

@@ -0,0 +1,53 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
INDIANAPOLIS
inherit
US_SHIP
redefine
arrival_location
end
create
make
feature -- Access
name: STRING_8 = "Indianapolis"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.hawaiian_islands
end
end

View File

@@ -0,0 +1,44 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
LEXINGTON
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Lexington"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 4
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 3
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = True
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,62 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
LOUISVILLE
inherit
US_SHIP
redefine
arrival_location,
arrival_port
end
create
make
feature -- Access
name: STRING_8 = "Louisville"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.coral_sea
end
arrival_port: like home_port
-- The port to which Current is assigned when it comes into
-- the game during a reinforcement action.
do
Result := game.australia
end
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
MARYLAND
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Maryland"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 5
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 5
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,53 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
MINNEAPOLIS
inherit
US_SHIP
redefine
arrival_location
end
create
make
feature -- Access
name: STRING_8 = "Minneapolis"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
arrival_location: LOCATION
-- The port or sea area at which this unit may enter the game
do
Result := game.hawaiian_islands
end
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
NEVADA
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "Nevada"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 4
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 4
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 3
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

View File

@@ -0,0 +1,45 @@
note
description: "[
Represents the corresponding ship in game.
]"
author: "Jimmy J. Johnson"
class
NEW_ORLEANS
inherit
US_SHIP
create
make
feature -- Access
name: STRING_8 = "New Orleans"
-- The name of this unit.
arrival_turn: INTEGER = 1
-- Turn on which this unit enters the game.
airstrike_factor: INTEGER = 0
-- The initial number of dice the unit rolls when attacking
-- during a "day action".
gunnery_factor: INTEGER = 1
-- The initial value for the number of dice the unit rolls
-- when attacking during a "night action".
defense_factor: INTEGER = 1
-- The number of damage points a unit can have without sinking.
-- (This is doubled when the unit is in port.)
speed_factor: INTEGER = 7
-- The initial "speed" of the unit.
attack_bonus: BOOLEAN = False
-- The initial setting saying if a unit can add one to each die roll.
-- If the unit is a carrier this applies only to the airstrike factor.
end

Some files were not shown because too many files have changed in this diff Show More