note description: "[ Class incapsulating each {ATTACK_UNIT} 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 because the order of calls to once featues may not work for persistence. ]" author: "Jimmy J. Johnson" deferred class ATTACK_UNIT_ATTRIBUTES feature -- Access game: VITP_GAME -- The game in which this item belongs. deferred end feature -- Constants initial_ship_size: INTEGER = 200 -- The size in millimeters of a {SHIP} or {SUBMARINE}. initial_air_size: INTEGER = 160 -- The size in millimeters of a {AIR_UNIT} or {AMPHIBIOUS_UNIT}. -- default_ship: DEFAULT_SHIP attribute create Result.make (game) end -- A {SHIP} for use where no other applies. feature -- Access (allied groups) allied_attack_units: VITP_TABLE [ATTACK_UNIT] -- All the US units attribute create Result.make (allied_ships.count + allied_air_units.count + allied_amphibious_units.count + allied_submarines.count) Result.merge (allied_ships) Result.merge (allied_air_units) Result.merge (allied_amphibious_units) Result.merge (allied_submarines) end position_uncertain_ships: VITP_TABLE [ATTACK_UNIT] -- All the "position uncertain" ships attribute create Result.make (4) Result.merge (Group_w) Result.merge (Group_x) Result.merge (Group_y) Result.merge (Group_z) end -- allied_returning_units: ARRAY [VITP_TABLE [ATTACK_UNIT]] -- -- Tables, indexed by turn, containing units that are to return -- -- to the game on that turn (i.e. amphibious or air units lost -- -- during turn 1 to turn 7 that are to return two turns latter). -- attribute -- local -- i: INTEGER -- do -- create Result.make_filled (create {VITP_TABLE [ATTACK_UNIT]}.make (10), 2,9) -- from i := 3 -- until i = 9 -- loop -- Result.put (create {VITP_TABLE [ATTACK_UNIT]}.make (10), i) -- i := i + 1 -- end -- end allied_turn_1_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on turn one, excluding -- the X, Y, Z, and W groups attribute create Result.make (25) Result.merge (turn_x_units (1, allied_ships)) Result.merge (turn_x_units (1, allied_air_units)) Result.merge (turn_x_units (1, allied_amphibious_units)) end allied_turn_2_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (25) Result.merge (turn_x_units (2, allied_ships)) Result.merge (turn_x_units (2, allied_air_units)) Result.merge (turn_x_units (2, allied_amphibious_units)) end allied_turn_3_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (25) Result.merge (turn_x_units (3, allied_ships)) Result.merge (turn_x_units (3, allied_air_units)) Result.merge (turn_x_units (3, allied_amphibious_units)) end allied_turn_4_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (25) Result.merge (turn_x_units (4, allied_ships)) Result.merge (turn_x_units (4, allied_air_units)) Result.merge (turn_x_units (4, allied_amphibious_units)) end allied_turn_5_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game this turn attribute create Result.make (25) Result.merge (turn_x_units (5, allied_ships)) Result.merge (turn_x_units (5, allied_air_units)) Result.merge (turn_x_units (5, allied_amphibious_units)) end allied_turn_6_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (12) Result.merge (turn_x_units (6, allied_ships)) Result.merge (turn_x_units (6, allied_air_units)) Result.merge (turn_x_units (6, allied_amphibious_units)) end allied_turn_7_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (12) Result.merge (turn_x_units (7, allied_ships)) Result.merge (turn_x_units (7, allied_air_units)) Result.merge (turn_x_units (7, allied_amphibious_units)) Result.extend (f_boat, f_boat.name) end allied_turn_8_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (5) Result.merge (turn_x_units (8, allied_ships)) Result.merge (turn_x_units (8, allied_air_units)) Result.merge (turn_x_units (8, allied_amphibious_units)) end allied_turn_9_units: VITP_TABLE [ATTACK_UNIT] -- The Allied units entering the game on this turn attribute create Result.make (5) Result.merge (turn_x_units (9, allied_ships)) Result.merge (turn_x_units (9, allied_air_units)) Result.merge (turn_x_units (9, allied_amphibious_units)) end group_w: VITP_TABLE [SHIP] -- Group W location uncertain ships attribute create Result.make (4) Result.extend (enterprise, enterprise.name) Result.extend (salt_lake_city, salt_lake_city.name) Result.extend (northampton, northampton.name) Result.extend (chester, chester.name) end group_x: VITP_TABLE [SHIP] -- Group X location uncertain ships attribute create Result.make (4) Result.extend (lexington, lexington.name) Result.extend (chicago, chicago.name) Result.extend (portland, portland.name) Result.extend (astoria, astoria.name) end group_y: VITP_TABLE [SHIP] -- Group Y location uncertain ships attribute create Result.make (1) Result.extend (saratoga, saratoga.name) end group_z: VITP_TABLE [SHIP] -- Group Z location uncertain ships attribute create Result.make (4) Result.extend (hornet, hornet.name) Result.extend (yorktown, yorktown.name) Result.extend (vincennes, vincennes.name) Result.extend (quincy, quincy.name) end allied_ships: VITP_TABLE [SHIP] -- All the allied ships -- Turn one attribute print (generating_type.out + ".allied_ships: finish me %N") create Result.make (50) Result.extend (nevada, nevada.name) Result.extend (arizona, arizona.name) Result.extend (west_virginia, west_virginia.name) Result.extend (tennessee, tennessee.name) Result.extend (oklahoma, oklahoma.name) Result.extend (maryland, maryland.name) Result.extend (california, california.name) Result.extend (pennsylvania, pennsylvania.name) Result.extend (new_orleans, new_orleans.name) Result.extend (san_francisco, san_francisco.name) Result.extend (hermes, hermes.name) Result.extend (revenge, revenge.name) Result.extend (prince_of_wales, prince_of_wales.name) Result.extend (repulse, repulse.name) Result.extend (louisville, louisville.name) Result.extend (pensacola, pensacola.name) Result.extend (indianapolis, indianapolis.name) Result.extend (minneapolis, minneapolis.name) Result.extend (houston, houston.name) Result.extend (exeter, exeter.name) Result.extend (de_ruyter, de_ruyter.name) Result.extend (australia_ship, australia_ship.name) Result.extend (canberra, canberra.name) -- Turn two Result.extend (royal_sovereign, royal_sovereign.name) Result.extend (ramilies, ramilies.name) Result.extend (resolution, resolution.name) Result.extend (warspite, warspite.name) Result.extend (indomitable, indomitable.name) Result.extend (formidable, formidable.name) Result.extend (cornwall, cornwall.name) Result.extend (dorestshire, dorestshire.name) Result.extend (new_mexico, new_mexico.name) Result.extend (idaho, idaho.name) -- Result.extend (tenth_af, tenth_af.name) -- Result.extend (eleventh_af, eleventh_af.name) -- Turn three Result.extend (north_carolina, north_carolina.name) Result.extend (mississippi, mississippi.name) Result.extend (colorado, colorado.name) -- Result.extend (marines_1, marines_1.name) -- Result.extend (marines_2, marines_2.name) -- Result.extend (raaf, raaf.name) -- Result.extend (rnzaf, rnzaf.name) Result.extend (valiant, valiant.name) Result.extend (illustrious, illustrious.name) -- Turn four Result.extend (south_dakota, south_dakota.name) Result.extend (indiana, indiana.name) Result.extend (washington, washington.name) Result.extend (wasp, wasp.name) -- Result.extend (marine, marine.name) -- Result.extend (thirteenth_af, thirteeth_af.name) Result.extend (devonshire, devonshire.name) Result.extend (shropshire, shropshire.name) -- Turn five Result.extend (massachusetts, massachusetts.name) Result.extend (wichita, wichita.name) Result.extend (victorious, victorious.name) -- Result.extend (marines_3, marines_3.name) -- Result.extend (fourteenth_af, fourteenth_af.name) -- Result.extend (naval, naval.name) -- Turn six Result.extend (alabama, alabama.name) Result.extend (essex, essex.name) Result.extend (cv_10, cv_10.name) Result.extend (cv_16, cv_16.name) Result.extend (independence, independence.name) Result.extend (princeton, princeton.name) Result.extend (belleau_wood, belleau_wood.name) Result.extend (cowpens, cowpens.name) Result.extend (monterey, monterey.name) Result.extend (baltimore, baltimore.name) Result.extend (boston, boston.name) -- Result.extend (marines_4, marines_4.name) -- Turn seven Result.extend (iowa, iowa.name) Result.extend (new_jersey, new_jersey.name) Result.extend (intrepid, intrepid.name) Result.extend (cv_12, cv_12.name) Result.extend (bunker_hill, bunker_hill.name) Result.extend (cv_18, cv_18.name) Result.extend (bataan, bataan.name) Result.extend (cabot, cabot.name) Result.extend (langley_ii, langley_ii.name) Result.extend (canberra_ii, canberra_ii.name) Result.extend (quincy_ii, quincy_ii.name) -- Result.extend (f_boat, f_boat.name) -- Turn eight Result.extend (wisconsin, wisconsin.name) Result.extend (missouri, missouri.name) Result.extend (ticonderoga, ticonderoga.name) Result.extend (san_jacinto, san_jacinto.name) -- Result.extend (marines_5, marines_5.name) -- Turn nine Result.extend (new_york, new_york.name) Result.extend (texas, texas.name) Result.extend (alaska, alaska.name) Result.extend (franklin, franklin.name) Result.extend (shangri_la, shangri_la.name) end allied_air_units: VITP_TABLE [AIR_UNIT] -- List of allied air units attribute create Result.make (10) Result.extend (Seventh_af, Seventh_af.name) Result.extend (Fifth_af, Fifth_af.name) Result.extend (Tenth_af, Tenth_af.name) Result.extend (Eleventh_af, Eleventh_af.name) Result.extend (raaf, raaf.name) Result.extend (rnzaf, rnzaf.name) Result.extend (Marine, Marine.name) Result.extend (Thirteenth_af, Thirteenth_af.name) Result.extend (Fourteenth_af, Fourteenth_af.name) Result.extend (Naval, Naval.name) end allied_amphibious_units: VITP_TABLE [AMPHIBIOUS_UNIT] -- All the allied_amphibious units attribute create Result.make (5) Result.extend (Marines_1, Marines_1.name) Result.extend (Marines_2, Marines_2.name) Result.extend (Marines_3, Marines_3.name) Result.extend (Marines_4, Marines_4.name) Result.extend (Marines_5, Marines_5.name) end allied_submarines: VITP_TABLE [SUBMARINE] -- The one us sub attribute create Result.make (1) Result.extend (f_boat, f_boat.name) end feature -- Access (Japaneae groups) japanese_attack_units: VITP_TABLE [ATTACK_UNIT] -- List of all Japanese units attribute create Result.make (japanese_ships.count + japanese_air_units.count + japanese_amphibious_units.count + japanese_submarines.count) Result.merge (japanese_ships) Result.merge (japanese_air_units) Result.merge (japanese_amphibious_units) Result.merge (japanese_submarines) end -- japanese_returning_units: ARRAY [VITP_TABLE [ATTACK_UNIT]] -- -- Tables, indexed by turn, containing units that are to return -- -- to the game on that turn (i.e. amphibious or air units lost -- -- during turn 1 to turn 7 that are to return two turns latter). -- attribute -- local -- i: INTEGER -- do -- create Result.make_filled (create {VITP_TABLE [ATTACK_UNIT]}.make (10), 3,9) -- from i := 3 -- until i = 9 -- loop -- Result.put (create {VITP_TABLE [ATTACK_UNIT]}.make (10), i) -- i := i + 1 -- end -- end japanese_turn_1_units: VITP_TABLE [ATTACK_UNIT] -- List of Japanese units that enter the game on turn one attribute create Result.make (39) Result.merge (turn_x_units (1, japanese_ships)) Result.merge (japanese_air_units) Result.merge (turn_x_units (1, japanese_amphibious_units)) Result.merge (japanese_submarines) end japanese_turn_2_units: VITP_TABLE [ATTACK_UNIT] -- Turn 2 attribute create Result.make (2) Result.extend (Shoho, Shoho.name) Result.extend (Junyo, Junyo.name) Result.extend (Sasebo, Sasebo.name) end japanese_turn_3_units: VITP_TABLE [ATTACK_UNIT] -- Turn 3 attribute create Result.make (2) Result.extend (Hiyo, Hiyo.name) Result.extend (Yamato, Yamato.name) Result.extend (Kure, Kure.name) end japanese_turn_4_units: VITP_TABLE [ATTACK_UNIT] -- Turn 4 attribute create Result.make (0) end japanese_turn_5_units: VITP_TABLE [ATTACK_UNIT] -- Turn 5 attribute create Result.make (1) Result.extend (Musashi, Musashi.name) end japanese_turn_6_units: VITP_TABLE [ATTACK_UNIT] -- Turn 6 attribute create Result.make (0) end japanese_turn_7_units: VITP_TABLE [ATTACK_UNIT] -- Turn 7 attribute create Result.make (4) Result.extend (Chiyoda, Chiyoda.name) Result.extend (Chitose, Chitose.name) Result.extend (Ryuho, Ryuho.name) Result.extend (Taiho, Taiho.name) end japanese_turn_8_units: VITP_TABLE [ATTACK_UNIT] -- Turn 8 attribute create Result.make (2) Result.extend (Unryu, Unryu.name) Result.extend (Amagi, Amagi.name) end japanese_turn_9_units: VITP_TABLE [ATTACK_UNIT] -- Turn 9 attribute create Result.make (2) Result.extend (Katsuragi, Katsuragi.name) Result.extend (Shinano, Shinano.name) end japanese_ships: VITP_TABLE [SHIP] -- All the Japanese ships attribute -- Turn 1 create Result.make (50) Result.extend (shokaku, shokaku.name) Result.extend (zuikaku, zuikaku.name) Result.extend (akagi, akagi.name) Result.extend (kaga, kaga.name) Result.extend (soryu, soryu.name) Result.extend (hiryu, hiryu.name) Result.extend (ryujo, ryujo.name) Result.extend (hosho, hosho.name) Result.extend (zuiho, zuiho.name) Result.extend (mutsu, mutsu.name) Result.extend (nagato, nagato.name) Result.extend (fuso, fuso.name) Result.extend (hyuga, hyuga.name) Result.extend (ise, ise.name) Result.extend (yamashiro, yamashiro.name) Result.extend (haruna, haruna.name) Result.extend (hiei, hiei.name) Result.extend (kirishima, kirishima.name) Result.extend (kongo, kongo.name) Result.extend (ashigara, ashigara.name) Result.extend (atago, atago.name) Result.extend (chokai, chokai.name) Result.extend (haguro, haguro.name) Result.extend (maya, maya.name) Result.extend (myoko, myoko.name) Result.extend (nachi, nachi.name) Result.extend (Takao, Takao.name) Result.extend (Chikuma, Chikuma.name) Result.extend (Kumano, Kumano.name) Result.extend (Mikuma, Mikuma.name) Result.extend (Mogami, Mogami.name) Result.extend (Suzuya, Suzuya.name) Result.extend (Tone, Tone.name) Result.extend (Aoba, Aoba.name) Result.extend (Furutaka, Furutaka.name) Result.extend (Kako, Kako.name) Result.extend (Kinugasa, Kinugasa.name) Result.extend (Kitakami, Kitakami.name) Result.extend (Oi, Oi.name) -- Turn 2 Result.extend (Shoho, Shoho.name) Result.extend (Junyo, Junyo.name) -- Turn 3 Result.extend (Hiyo, Hiyo.name) Result.extend (Yamato, Yamato.name) -- Turn 4 -- no ships -- Turn 5 Result.extend (Musashi, Musashi.name) -- Turn 6 -- no ships -- Turn 7 Result.extend (Chiyoda, Chiyoda.name) Result.extend (Chitose, Chitose.name) Result.extend (Ryuho, Ryuho.name) Result.extend (Taiho, Taiho.name) -- Turn 8 Result.extend (Unryu, Unryu.name) Result.extend (Amagi, Amagi.name) -- Turn 9 Result.extend (Katsuragi, Katsuragi.name) Result.extend (Shinano, Shinano.name) end japanese_air_units: VITP_TABLE [AIR_UNIT] -- List of allied air units attribute create Result.make (10) Result.extend (Airflot_21, Airflot_21.name) Result.extend (Airflot_22, Airflot_22.name) Result.extend (Airflot_23, Airflot_23.name) Result.extend (Airflot_24, Airflot_24.name) Result.extend (Airflot_25, Airflot_25.name) Result.extend (Airflot_26, Airflot_26.name) end japanese_amphibious_units: VITP_TABLE [AMPHIBIOUS_UNIT] -- All the allied_amphibious units attribute create Result.make (3) Result.extend (Yokosuka, Yokosuka.name) Result.extend (Sasebo, Sasebo.name) Result.extend (Kure, Kure.name) end japanese_submarines: VITP_TABLE [SUBMARINE] -- The one us sub attribute create Result.make (1) Result.extend (i_boat, i_boat.name) end feature -- Access (combined groups) all_ships: VITP_TABLE [SHIP] -- List of *all* ships attribute create Result.make (100) Result.merge (japanese_ships) Result.merge (allied_ships) end all_air_units: VITP_TABLE [AIR_UNIT] -- List of *all* LBA units attribute create Result.make (20) Result.merge (japanese_air_units) Result.merge (allied_air_units) end all_amphibious_units: VITP_TABLE [AMPHIBIOUS_UNIT] -- List of *all* amphibious units attribute create Result.make (20) Result.merge (japanese_amphibious_units) Result.merge (allied_amphibious_units) end all_attack_units: VITP_TABLE [ATTACK_UNIT] -- List of *all* units attribute create Result.make (japanese_attack_units.count + allied_attack_units.count) Result.merge (japanese_attack_units) Result.merge (allied_attack_units) end feature -- Query -- turn_x_task_forces (a_turn: INTEGER): LINKED_SET [VITP_MOVEABLE] -- -- Units for `a_turn' grouped together by nationality at a location -- local -- visited: LINKED_SET [VITP_MOVEABLE] -- u: ATTACK_UNIT -- fnd: BOOLEAN -- do -- create Result.make -- create visited.make -- -- Get allied units -- from Allied_ships.start -- until Allied_ships.after -- loop -- u := Allied_ships.item_for_iteration -- if u.arrival_turn = a_turn or u.returning_turn = a_turn then -- fnd := False -- from Result.start -- until Result.exhausted or fnd -- loop -- if u.arrival_location = Result.item.arrival_location then -- u.join_forces (Result.item) -- fnd := True -- end -- Result.forth -- end -- if not fnd then -- Result.extend (u) -- end -- end -- Allied_ships.forth -- end -- end turn_x_units (a_turn: INTEGER; a_table: VITP_TABLE [ATTACK_UNIT]): VITP_TABLE [ATTACK_UNIT] -- The units entering the game at the beginning of `a_turn' local u: ATTACK_UNIT do create result.make (30) from a_table.start until a_table.after loop u := a_table.item_for_iteration if u.arrival_turn = a_turn or u.returning_turn = a_turn then Result.extend (u, u.name) end a_table.forth end end arriving_japanese_ships (a_turn: INTEGER): VITP_TABLE [SHIP] -- The Japanese ships entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [SHIP] u: SHIP do tab := Japanese_ships create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_allied_ships (a_turn: INTEGER): VITP_TABLE [SHIP] -- The Allied units entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [SHIP] u: SHIP do tab := Allied_ships create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_japanese_air_units (a_turn: INTEGER): VITP_TABLE [AIR_UNIT] -- The Japanese air units entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [AIR_UNIT] u: AIR_UNIT do tab := Japanese_air_units create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_allied_air_units (a_turn: INTEGER): VITP_TABLE [AIR_UNIT] -- The Allied units entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [AIR_UNIT] u: AIR_UNIT do tab := Allied_air_units create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_japanese_amphibious_units (a_turn: INTEGER): VITP_TABLE [AMPHIBIOUS_UNIT] -- The Japanese ships entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [AMPHIBIOUS_UNIT] u: AMPHIBIOUS_UNIT do tab := Japanese_amphibious_units create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_allied_amphibious_units (a_turn: INTEGER): VITP_TABLE [AMPHIBIOUS_UNIT] -- The Allied amphibious units entering the game on this turn that -- have not already been placed on the board. local tab: VITP_TABLE [AMPHIBIOUS_UNIT] u: AMPHIBIOUS_UNIT do tab := Allied_amphibious_units create Result.make (30) from tab.start until tab.after loop u := tab.item_for_iteration if u.arrival_turn = a_turn and then not u.is_in_game then Result.extend (u, u.name) end tab.forth end end arriving_japanese_submarines (a_turn: INTEGER): VITP_TABLE [SUBMARINE] -- The Japanese submarines entering the game on this turn that -- have not already been placed on the board. do create Result.make (30) if i_boat.arrival_turn = a_turn and then not i_boat.is_in_game then Result.extend (i_boat, i_boat.name) end end arriving_allied_submarines (a_turn: INTEGER): VITP_TABLE [SUBMARINE] -- The Allied submarines entering the game on this turn that -- have not already been placed on the board. do create Result.make (30) if f_boat.arrival_turn = a_turn and then not f_boat.is_in_game then Result.extend (f_boat, f_boat.name) end end returning_allied_air_units (a_turn: INTEGER): VITP_TABLE [AIR_UNIT] -- The Allied air units that are returning to the game on `a_turn' require turn_big_enough: a_turn >= 3 turn_small_enough: a_turn <= 9 local tab: VITP_TABLE [AIR_UNIT] u: AIR_UNIT do tab := allied_air_units create Result.make (10) from tab.start until tab.after loop u := tab.item_for_iteration if u.returning_turn = a_turn then Result.extend (u, u.name) end tab.forth end end returning_japanese_air_units (a_turn: INTEGER): VITP_TABLE [AIR_UNIT] -- The Allied air units that are returning to the game on `a_turn' require turn_big_enough: a_turn >= 3 turn_small_enough: a_turn <= 9 local tab: VITP_TABLE [AIR_UNIT] u: AIR_UNIT do tab := japanese_air_units create Result.make (10) from tab.start until tab.after loop u := tab.item_for_iteration if u.returning_turn = a_turn then Result.extend (u, u.name) end tab.forth end end returning_allied_amphibious_units (a_turn: INTEGER): VITP_TABLE [AMPHIBIOUS_UNIT] -- The Allied amphibious units that are returning to the game on `a_turn' require turn_big_enough: a_turn >= 3 turn_small_enough: a_turn <= 9 local tab: VITP_TABLE [AMPHIBIOUS_UNIT] u: AMPHIBIOUS_UNIT do tab := allied_amphibious_units create Result.make (10) from tab.start until tab.after loop u := tab.item_for_iteration if u.returning_turn = a_turn then Result.extend (u, u.name) end tab.forth end end returning_japanese_amphibious_units (a_turn: INTEGER): VITP_TABLE [AMPHIBIOUS_UNIT] -- The Allied amphibious units that are returning to the game on `a_turn' require turn_big_enough: a_turn >= 3 turn_small_enough: a_turn <= 9 local tab: VITP_TABLE [AMPHIBIOUS_UNIT] u: AMPHIBIOUS_UNIT do tab := japanese_amphibious_units create Result.make (10) from tab.start until tab.after loop u := tab.item_for_iteration if u.returning_turn = a_turn then Result.extend (u, u.name) end tab.forth end end returning_turn_x_units (a_turn: INTEGER; a_table: VITP_TABLE [ATTACK_UNIT]): VITP_TABLE [ATTACK_UNIT] -- The units returning to the game at the beginning of `a_turn' local u: ATTACK_UNIT do create result.make (30) from a_table.start until a_table.after loop u := a_table.item_for_iteration if u.returning_turn = a_turn then Result.extend (u, u.name) end a_table.forth end end returning_turn_3_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (3, Japanese_air_units)) Result.merge (returning_turn_x_units (3, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (3, Allied_air_units)) Result.merge (returning_turn_x_units (3, Allied_amphibious_units)) end returning_turn_4_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (4, Japanese_air_units)) Result.merge (returning_turn_x_units (4, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (4, Allied_air_units)) Result.merge (returning_turn_x_units (4, Allied_amphibious_units)) end returning_turn_5_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (5, Japanese_air_units)) Result.merge (returning_turn_x_units (5, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (5, Allied_air_units)) Result.merge (returning_turn_x_units (5, Allied_amphibious_units)) end returning_turn_6_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (6, Japanese_air_units)) Result.merge (returning_turn_x_units (6, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (6, Allied_air_units)) Result.merge (returning_turn_x_units (6, Allied_amphibious_units)) end returning_turn_7_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (7, Japanese_air_units)) Result.merge (returning_turn_x_units (7, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (7, Allied_air_units)) Result.merge (returning_turn_x_units (7, Allied_amphibious_units)) end returning_turn_8_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (8, Japanese_air_units)) Result.merge (returning_turn_x_units (8, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (8, Allied_air_units)) Result.merge (returning_turn_x_units (8, Allied_amphibious_units)) end returning_turn_9_units: VITP_TABLE [ATTACK_UNIT] -- Air or amphibious units returning on turn 3 do create Result.make (10) Result.merge (returning_turn_x_units (9, Japanese_air_units)) Result.merge (returning_turn_x_units (9, Japanese_amphibious_units)) Result.merge (returning_turn_x_units (9, Allied_air_units)) Result.merge (returning_turn_x_units (9, Allied_amphibious_units)) end Turn_1_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (50) Result.merge (Allied_turn_1_units) Result.merge (Japanese_turn_1_units) end Turn_2_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (50) Result.merge (Allied_turn_2_units) Result.merge (Japanese_turn_2_units) end turn_3_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_3_units) Result.merge (Japanese_turn_3_units) Result.merge (returning_turn_3_units) end turn_4_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_4_units) Result.merge (Japanese_turn_4_units) Result.merge (returning_turn_4_units) end turn_5_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_5_units) Result.merge (Japanese_turn_5_units) Result.merge (returning_turn_5_units) end turn_6_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_6_units) Result.merge (Japanese_turn_6_units) Result.merge (returning_turn_6_units) end turn_7_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_7_units) Result.merge (Japanese_turn_7_units) Result.merge (returning_turn_7_units) end turn_8_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_8_units) Result.merge (Japanese_turn_8_units) Result.merge (returning_turn_8_units) end turn_9_reinforcements: VITP_TABLE [ATTACK_UNIT] -- All the units coming into the game on this turn do create Result.make (30) Result.merge (Allied_turn_9_units) Result.merge (Japanese_turn_9_units) Result.merge (returning_turn_9_units) end feature -- Access (Japanese units) -- Turn 1, row 1 shokaku: SHOKAKU attribute create Result.make (game) end zuikaku: ZUIKAKU attribute create Result.make (game) end akagi: AKAGI attribute create Result.make (game) end kaga: KAGA attribute create Result.make (game) end soryu: SORYU attribute create Result.make (game) end hiryu: HIRYU attribute create Result.make (game) end ryujo: RYUJO attribute create Result.make (game) end hosho: HOSHO attribute create Result.make (game) end zuiho: ZUIHO attribute create Result.make (game) end mutsu: MUTSU attribute create Result.make (game) end nagato: NAGATO attribute create Result.make (game) end fuso: FUSO attribute create Result.make (game) end -- Turn 1, row 2 hyuga: HYUGA attribute create Result.make (game) end ise: ISE attribute create Result.make (game) end yamashiro: YAMASHIRO attribute create Result.make (game) end haruna: HARUNA attribute create Result.make (game) end hiei: HIEI attribute create Result.make (game) end kirishima: KIRISHIMA attribute create Result.make (game) end kongo: KONGO attribute create Result.make (game) end ashigara: ASHIGARA attribute create Result.make (game) end atago: ATAGO attribute create Result.make (game) end chokai: CHOKAI attribute create Result.make (game) end haguro: HAGURO attribute create Result.make (game) end maya: MAYA attribute create Result.make (game) end -- Turn 1, row 3 myoko: MYOKO attribute create Result.make (game) end nachi: NACHI attribute create Result.make (game) end takao: TAKAO attribute create Result.make (game) end chikuma: CHIKUMA attribute create Result.make (game) end kumano: KUMANO attribute create Result.make (game) end mikuma: MIKUMA attribute create Result.make (game) end mogami: MOGAMI attribute create Result.make (game) end suzuya: SUZUYA attribute create Result.make (game) end tone: TONE attribute create Result.make (game) end aoba: AOBA attribute create Result.make (game) end furutaka: FURUTAKA attribute create Result.make (game) end kako: KAKO attribute create Result.make (game) end -- Turn 1, row 4 kinugasa: KINUGASA attribute create Result.make (game) end kitakami: KITAKAMI attribute create Result.make (game) end oi: OI attribute create Result.make (game) end yokosuka: YOKOSUKA attribute create Result.make (game) end -- Turn 1, also available airflot_21: AIRFLOT_21 attribute create Result.make (game) end airflot_22: AIRFLOT_22 attribute create Result.make (game) end airflot_23: AIRFLOT_23 attribute create Result.make (game) end airflot_24: AIRFLOT_24 attribute create Result.make (game) end airflot_25: AIRFLOT_25 attribute create Result.make (game) end airflot_26: AIRFLOT_26 attribute create Result.make (game) end i_boat: I_BOAT attribute create Result.make (game) end -- Turn 2 shoho: SHOHO attribute create Result.make (game) end junyo: JUNYO attribute create Result.make (game) end sasebo: SASEBO attribute create Result.make (game) end -- Turn 3 hiyo: HIYO attribute create Result.make (game) end yamato: YAMATO attribute create Result.make (game) end kure: KURE attribute create Result.make (game) end -- Turn 5 musashi: MUSASHI attribute create Result.make (game) end -- Turn 7 chiyoda: CHIYODA attribute create Result.make (game) end chitose: CHITOSE attribute create Result.make (game) end ryuho: RYUHO attribute create Result.make (game) end taiho: TAIHO attribute create Result.make (game) end -- Turn 7 removal i_boat_removal: I_BOAT_REMOVAL attribute create Result.make (game) end -- Turn 8 unryu: UNRYU attribute create Result.make (game) end amagi: AMAGI attribute create Result.make (game) end -- Turn 9 katsuragi: KATSURAGI attribute create Result.make (game) end shinano: SHINANO attribute create Result.make (game) end feature -- Allied units -- On Battleship Row (Pearl Harbor) nevada: NEVADA attribute create Result.make (game) end arizona: ARIZONA attribute create Result.make (game) end west_virginia: WEST_VIRGINIA attribute create Result.make (game) end tennessee: TENNESSEE attribute create Result.make (game) end oklahoma: OKLAHOMA attribute create Result.make (game) end maryland: MARYLAND attribute create Result.make (game) end california: CALIFORNIA attribute create Result.make (game) end pennsylvania: PENNSYLVANIA attribute create Result.make (game) end new_orleans: NEW_ORLEANS attribute create Result.make (game) end san_francisco: SAN_FRANCISCO attribute create Result.make (game) end seventh_af: SEVENTH_AF attribute create Result.make (game) end -- At sea (cannot move) hermes: HERMES attribute create Result.make (game) end revenge: REVENGE attribute create Result.make (game) end prince_of_wales: PRINCE_OF_WALES attribute create Result.make (game) end repulse: REPULSE attribute create Result.make (game) end fifth_af: FIFTH_AF attribute create Result.make (game) end louisville: LOUISVILLE attribute create Result.make (game) end pensacola: PENSACOLA attribute create Result.make (game) end indianapolis: INDIANAPOLIS attribute create Result.make (game) end minneapolis: MINNEAPOLIS attribute create Result.make (game) end -- In port (may move) houston: HOUSTON attribute create Result.make (game) end exeter:EXETER attribute create Result.make (game) end de_ruyter: DE_RUYTER attribute create Result.make (game) end australia_ship: AUSTRALIA_SHIP attribute create Result.make (game) end canberra: CANBERRA attribute create Result.make (game) end -- Location Uncertain, group W enterprise: ENTERPRISE attribute create Result.make (game) end salt_lake_city: SALT_LAKE_CITY attribute create Result.make (game) end northampton: NORTHAMPTON attribute create Result.make (game) end chester: CHESTER attribute create Result.make (game) end -- Location Uncertain, group X lexington: LEXINGTON attribute create Result.make (game) end chicago: CHICAGO attribute create Result.make (game) end portland: PORTLAND attribute create Result.make (game) end astoria: ASTORIA attribute create Result.make (game) end -- Location Uncertain, group Y saratoga: SARATOGA attribute create Result.make (game) end -- Location Uncertain, group Z hornet: HORNET attribute create Result.make (game) end yorktown: YORKTOWN attribute create Result.make (game) end vincennes: VINCENNES attribute create Result.make (game) end quincy: QUINCY attribute create Result.make (game) end -- Turn 2 royal_sovereign: ROYAL_SOVEREIGN attribute create Result.make (game) end ramilies: RAMILIES attribute create Result.make (game) end resolution: RESOLUTION attribute create Result.make (game) end warspite: WARSPITE attribute create Result.make (game) end indomitable: INDOMITABLE attribute create Result.make (game) end formidable: FORMIDABLE attribute create Result.make (game) end cornwall: CORNWALL attribute create Result.make (game) end dorestshire: DORESTSHIRE attribute create Result.make (game) end new_mexico: NEW_MEXICO attribute create Result.make (game) end idaho: IDAHO attribute create Result.make (game) end tenth_af: TENTH_AF attribute create Result.make (game) end eleventh_af: ELEVENTH_AF attribute create Result.make (game) end -- Turn 3 north_carolina: NORTH_CAROLINA attribute create Result.make (game) end mississippi: MISSISSIPPI attribute create Result.make (game) end colorado: COLORADO attribute create Result.make (game) end marines_1: MARINES_1 attribute create Result.make (game) end marines_2: MARINES_2 attribute create Result.make (game) end raaf: RAAF attribute create Result.make (game) end rnzaf: RNZAF attribute create Result.make (game) end valiant: VALIANT attribute create Result.make (game) end illustrious: ILLUSTRIOUS attribute create Result.make (game) end -- Turn 4 south_dakota: SOUTH_DAKOTA attribute create Result.make (game) end indiana: INDIANA attribute create Result.make (game) end washington: WASHINGTON attribute create Result.make (game) end wasp: WASP attribute create Result.make (game) end marine: MARINE attribute create Result.make (game) end thirteenth_af: THIRTEENTH_AF attribute create Result.make (game) end devonshire: DEVONSHIRE attribute create Result.make (game) end shropshire: SHROPSHIRE attribute create Result.make (game) end first_027_removal: CV_027_REMOVAL attribute create Result.make (game) end second_027_removal: CV_027_REMOVAL attribute create Result.make (game) end -- Turn 5 massachusetts: MASSACHUSETTS attribute create Result.make (game) end wichita: WICHITA attribute create Result.make (game) end victorious: VICTORIOUS attribute create Result.make (game) end marines_3: MARINES_3 attribute create Result.make (game) end fourteenth_af: FOURTEENTH_AF attribute create Result.make (game) end naval: NAVAL attribute create Result.make (game) end resolution_removal: RESOLUTION_REMOVAL attribute create Result.make (game) end revenge_removal: REVENGE_REMOVAL attribute create Result.make (game) end valiant_removal: VALIANT_REMOVAL attribute create Result.make (game) end warspite_removal: WARSPITE_REMOVAL attribute create Result.make (game) end -- Turn 6 alabama: ALABAMA attribute create Result.make (game) end essex: ESSEX attribute create Result.make (game) end cv_10: CV_10 attribute create Result.make (game) end cv_16: CV_16 attribute create Result.make (game) end independence: INDEPENDENCE attribute create Result.make (game) end princeton: PRINCETON attribute create Result.make (game) end belleau_wood: BELLEAU_WOOD attribute create Result.make (game) end cowpens: COWPENS attribute create Result.make (game) end monterey: MONTEREY attribute create Result.make (game) end baltimore: BALTIMORE attribute create Result.make (game) end boston: BOSTON attribute create Result.make (game) end marines_4: MARINES_4 attribute create Result.make (game) end victorious_removal: VICTORIOUS_REMOVAL attribute create Result.make (game) end -- Turn 7 iowa: IOWA attribute create Result.make (game) end new_jersey: NEW_JERSEY attribute create Result.make (game) end intrepid: INTREPID attribute create Result.make (game) end cv_12: CV_12 attribute create Result.make (game) end bunker_hill: BUNKER_HILL attribute create Result.make (game) end cv_18: CV_18 attribute create Result.make (game) end bataan: BATAAN attribute create Result.make (game) end cabot: CABOT attribute create Result.make (game) end langley_ii: LANGLEY_II attribute create Result.make (game) end canberra_ii: CANBERA_II attribute create Result.make (game) end quincy_ii: QUINCY_II attribute create Result.make (game) end f_boat: F_BOAT attribute create Result.make (game) end third_027_removal: CV_027_REMOVAL attribute create Result.make (game) end first_443_removal: CV_443_REMOVAL attribute create Result.make (game) end -- Turn 8 wisconsin: WISCONSIN attribute create Result.make (game) end missouri: MISSOURI attribute create Result.make (game) end ticonderoga: TICONDEROGA attribute create Result.make (game) end san_jacinto: SAN_JACINTO attribute create Result.make (game) end marines_5: MARINES_5 attribute create Result.make (game) end -- Turn 9 new_york: NEW_YORK attribute create Result.make (game) end texas: TEXAS attribute create Result.make (game) end alaska: ALASKA attribute create Result.make (game) end franklin: FRANKLIN attribute create Result.make (game) end shangri_la: SHANGRI_LA attribute create Result.make (game) end end