init
This commit is contained in:
1390
jj_vitp/Interface/widgets/sea_area_widgets/aleutian_islands_widget.e
Normal file
1390
jj_vitp/Interface/widgets/sea_area_widgets/aleutian_islands_widget.e
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents the Bay of Bengal in VITP
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
BAY_OF_BENGAL_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
position_widgets,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- translate_widget (text_widget, -10, 150)
|
||||
-- text_widget.set_x_y (70, 150)
|
||||
-- translate_widget (dot, -20, 80)
|
||||
-- name_mt.set_point_position (15, 345)
|
||||
text_group.set_x_y (15, 345)
|
||||
flag.set_point_position (20, 320)
|
||||
dot.set_point_position (20, 310)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- Start at top left of board, going to point north of Saigon
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (98, 190)) -- measured to west point of Siagon
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (72, 244)) -- estimated
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (40, 257))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (83, 355))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 392))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
---- bounding_figure.extend_point (ocean.point_array.item (0))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 167))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (20, 155))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (50, 152))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (60, 190))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (77, 195))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (1))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (2))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (3))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (4))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (5))
|
||||
-- jj_bounding_figure.extend_point (ocean.point_array.item (0))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.bay_of_bengal
|
||||
|
||||
end
|
@@ -0,0 +1,79 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
CENTRAL_PACIFIC_OCEAN_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
position_widgets,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
translate_widget (text_group, -30, 50)
|
||||
translate_widget (dot, 20, 80)
|
||||
-- flag.center_on_dot (dot)
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
translate_widget (flag, -10, -2)
|
||||
translate_widget (dot, -20, 30)
|
||||
translate_widget (Current, 526, 101)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at northern most point
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (79, 32))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (112, 136))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (74, 200))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-41, 146)) -- x may be off
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-77, 81))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (79, 32))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (112, 136))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (74, 200))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-41, 146)) -- x may be off
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-77, 81))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- -- Make adjustments
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
-- translate_widget (jj_bounding_figure, 526, 101)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.central_pacific_ocean
|
||||
has_no_land: land.is_empty
|
||||
|
||||
end
|
148
jj_vitp/Interface/widgets/sea_area_widgets/coral_sea_widget.e
Normal file
148
jj_vitp/Interface/widgets/sea_area_widgets/coral_sea_widget.e
Normal file
@@ -0,0 +1,148 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
CORAL_SEA_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
create_interface_objects,
|
||||
position_widgets,
|
||||
build_land,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
create_interface_objects
|
||||
-- Initialize attributes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
new_caledonia := new_caledonia_imp
|
||||
end
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
translate_widget (Current, 284, 554)
|
||||
translate_widget (dot, 100, -45)
|
||||
translate_widget (text_group, 85, -75)
|
||||
translate_widget (land, 5, 0)
|
||||
-- flag.center_on_dot (dot)
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
end
|
||||
|
||||
build_land
|
||||
-- Add `land' to Current
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- This land was used to help position the
|
||||
-- brown land in the {SOLOMANS_WIDGET} or
|
||||
-- [or SOUTH_PACIFIC_OCEAN_WIDGET if fixed].
|
||||
-- land.extend (new_caledonia)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
|
||||
-- start at bottom edge of board at west end measuring from bottom
|
||||
-- The first two points are hidden by Australia, but should still be
|
||||
-- close to those points, 3mm away.
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- Under Lae
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (28, -165)) -- estimated
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (66, -123)) --
|
||||
-- Under Guadalcanale
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (114, -100)) -- estimated
|
||||
-- x is 39 left of bottom (measured from right)
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (123, -109)) -- estimate
|
||||
-- x is 5 more than bottom (measured from right)
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (167, -112))
|
||||
-- 704, board width, - 258 measured from bottom/right = 446
|
||||
-- 446 - (281, Indian Ocean point, + 3) = 162
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (162, 1)) --0))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- local
|
||||
-- t: EV_MODEL_TRANSFORMATION
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (60, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (65, -40))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (30, -90))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (23, -140))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (120, -80))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (167, -112))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (162, 0))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
-- -- Make adjustments
|
||||
-- translate_widget (jj_bounding_figure, 284, 553)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
feature -- Access
|
||||
|
||||
new_caledonia: EV_MODEL_POLYGON
|
||||
-- Island (brown on the board) south-west of New Heberdies
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
new_caledonia_imp: EV_MODEL_POLYGON
|
||||
-- Create the polygon island north of Australia
|
||||
|
||||
local
|
||||
t: EV_MODEL_TRANSFORMATION
|
||||
do
|
||||
create Result
|
||||
-- Start at north-west tip
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1, 0.5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1.5, 1))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (5, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (5.5, 5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (7, 5.5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (9, 9))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (12.5, 11))
|
||||
-- South-east tip
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (17, 19))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (16, 19.5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (14, 19))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (10, 16))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (7, 15))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (6, 16))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (6, 15))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (2, 8))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0, 2))
|
||||
create t.make_zero
|
||||
t.translate (130, -48) -- 553 is the board height (not including black boarder)
|
||||
Result.transform (t)
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.coral_sea
|
||||
|
||||
end
|
@@ -0,0 +1,77 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
HAWAIIAN_ISLANDS_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
position_widgets,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
translate_widget (name_mt, -75, -85)
|
||||
translate_widget (dot, -45, -60)
|
||||
-- flag.center_on_dot (dot)
|
||||
-- flag.set_x_y (dot.x, dot.y)
|
||||
flag.set_x_y (-45, -60)
|
||||
translate_widget (dot, -60, -40)
|
||||
translate_widget (Current, 704, 553 - 72)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at bottom south-west corner
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-150, -95))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-62, -244))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, -242))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- local
|
||||
-- t: EV_MODEL_TRANSFORMATION
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-150, -95))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-62, -244))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, -242))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- -- Make adjustments
|
||||
-- translate_widget (jj_bounding_figure, 704, 553 - 72)
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.hawaiian_islands
|
||||
no_land: land.is_empty
|
||||
|
||||
end
|
342
jj_vitp/Interface/widgets/sea_area_widgets/indian_ocean_widget.e
Normal file
342
jj_vitp/Interface/widgets/sea_area_widgets/indian_ocean_widget.e
Normal file
@@ -0,0 +1,342 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents the Indian Ocean in VITP
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
INDIAN_OCEAN_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
create_interface_objects,
|
||||
position_widgets,
|
||||
build_land,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
create_interface_objects
|
||||
-- Initialize attributes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
yamdena := yamdena_imp
|
||||
pulau := pulau_imp
|
||||
end
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- make adjustments
|
||||
scale_widget (land, 0.04)
|
||||
rotate_widget (land, 13.0)
|
||||
-- translate_widget (Current, 0, 553)
|
||||
-- translate_widget (land, 10, -20)
|
||||
-- translate_widget (text_widget, -80, -20)
|
||||
-- translate_widget (dot, -75, 50)
|
||||
-- flag.center_on_dot (dot)
|
||||
land.set_point_position (240, -165)
|
||||
dot.set_point_position (80, -100)
|
||||
set_point_position (0, 553)
|
||||
flag.set_point_position (60, 410)
|
||||
name_mt.set_point_position (30, 440)
|
||||
end
|
||||
|
||||
build_land
|
||||
-- Build any land in Current
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
land.extend (yamdena)
|
||||
land.extend (Pulau)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at bottom-left edge of board, measuring from bottom
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, -158))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (84, -195))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (195, -151))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (278, -185)) -- estimated
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (308, -161))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (281, 0))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- local
|
||||
-- t: EV_MODEL_TRANSFORMATION
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, -158))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (84, -195))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (195, -151))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (278, -185))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (308, -161))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (281, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (130, -90))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (130, 0))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
-- create t.make_zero
|
||||
-- t.translate (0, 553) -- 553 is the board height (not including black boarder)
|
||||
-- jj_bounding_figure.transform (t)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
feature -- Access
|
||||
|
||||
yamdena: EV_MODEL_POLYGON
|
||||
pulau: EV_MODEL_POLYGON
|
||||
|
||||
feature {NONE} -- Implementatio
|
||||
|
||||
yamdena_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-1, -11))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (8, -14))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (14, -18))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (25, -18))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (27, -12))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (39, -19))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (51, -19))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (68, -21))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (87, -43))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (83, -32))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (74, -19))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (83, -8))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (83, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (69, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (68, -5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (39, -8))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (39, -1))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (23, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (21, 11))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (27, 32))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (31, 36))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (30, 41))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (24, 61))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (18, 80))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (3, 95))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-6, 95))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-6, 103))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-15, 110))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-27, 119))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-26, 127))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-31, 132))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-31, 143))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-43, 153))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-40, 137))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-41, 130))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-47, 138))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-53, 148))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-60, 144))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-67, 144))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-74, 144))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-72, 128))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-78, 125))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-79, 118))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-76, 112))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-72, 114))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-68, 109))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-72, 105))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-71, 99))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-79, 95))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-75, 86))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-82, 91))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-84, 86))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-89, 87))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-88, 94))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-100, 96))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-100, 86))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-75, 78))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-71, 89))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-64, 93))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-54, 93))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-60, 89))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-67, 82))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-63, 76))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-62, 70))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-56, 62))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-53, 50))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-40, 40))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-36, 33))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-32, 42))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-28, 35))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-27, 29))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-24, 21))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-14, 22))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-15, 17))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-11, 8))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-12, 4))
|
||||
end
|
||||
|
||||
pulau_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (537, -323))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (547, -339))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (558, -345))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (563, -337))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (570, -328))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (582, -311))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (577, -307))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (581, -294))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (586, -291))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (591, -280))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (585, -279))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (587, -268))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (592, -257))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (582, -257))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (593, -249))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (594, -241))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (588, -240))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (583, -241))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (589, -234))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (589, -227))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (585, -223))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (585, -216))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (590, -209))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (596, -206))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (590, -197))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (592, -191))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (585, -168))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (579, -160))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (567, -157))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (564, -152))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (564, -141))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (558, -133))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (567, -138))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (577, -141))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (587, -136))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (592, -130))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (597, -138))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (597, -148))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (594, -157))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (601, -167))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (607, -171))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (614, -169))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (617, -159))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (610, -150))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (609, -139))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (604, -135))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (599, -122))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (592, -123))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (588, -118))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (589, -111))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (597, -105))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (589, -103))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (586, -92))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (575, -79))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (569, -82))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (566, -84))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (568, -90))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (566, -93))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (573, -95))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (574, -103))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (577, -115))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (581, -117))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (575, -118))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (572, -127))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (567, -131))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (556, -121))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (545, -125))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (539, -123))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (542, -120))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (541, -114))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (546, -117))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (549, -108))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (545, -105))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (537, -99))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (532, -101))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (535, -94))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (527, -87))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (526, -83))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (518, -77))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (522, -73))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (510, -65))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (490, -53))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (490, -47))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (485, -52))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (478, -66))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (470, -65))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (463, -70))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (460, -80))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (465, -92))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (469, -136))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (473, -144))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (472, -151))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (475, -164))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (474, -177))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (468, -189))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (469, -194))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (476, -191))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (488, -196))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (486, -199))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (479, -196))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (473, -204))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (474, -209))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (474, -215))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (481, -223))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (485, -215))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (490, -218))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (495, -212))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (505, -217))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (509, -230))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (505, -236))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (503, -239))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (511, -245))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (508, -250))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (516, -251))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (517, -256))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (521, -260))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (519, -263))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (512, -260))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (509, -266))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (501, -265))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (497, -258))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (494, -253))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (489, -252))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (488, -266))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (496, -264))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (498, -268))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (489, -276))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (497, -284))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (509, -278))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (514, -274))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (515, -282))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (527, -295))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (530, -307))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (540, -302))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (543, -309))
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.indian_ocean
|
||||
|
||||
end
|
1959
jj_vitp/Interface/widgets/sea_area_widgets/indonesia_widget.e
Normal file
1959
jj_vitp/Interface/widgets/sea_area_widgets/indonesia_widget.e
Normal file
File diff suppressed because it is too large
Load Diff
1878
jj_vitp/Interface/widgets/sea_area_widgets/japanese_islands_widget.e
Normal file
1878
jj_vitp/Interface/widgets/sea_area_widgets/japanese_islands_widget.e
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,281 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
MARIANAS_ISLANDS_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
create_interface_objects,
|
||||
position_widgets,
|
||||
build_land,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
create_interface_objects
|
||||
-- Initialize attributes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
iwo_jima := iwo_jima_imp
|
||||
tinian := tinian_imp
|
||||
saipan_mainland := saipan_mainland_imp
|
||||
rota := rota_imp
|
||||
guam := guam_imp
|
||||
colonia := colonia_imp
|
||||
palau := palau_imp
|
||||
end
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
scale_widget (land, 0.15)
|
||||
rotate_widget (land, 13.0)
|
||||
-- translate_widget (Current, 446, 183)
|
||||
-- translate_widget (text_widget, 0, -20)
|
||||
-- translate_widget (dot, 0, 30)
|
||||
-- translate_widget (land, -21, 2)
|
||||
set_point_position (446, 183)
|
||||
land.set_point_position (351, 195)
|
||||
name_mt.set_point_position (285, 220)
|
||||
dot.set_point_position (315, 247)
|
||||
-- flag.center_on_dot (dot)
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
dot.set_point_position (310, 270)
|
||||
|
||||
dot.set_foreground_color (Yellow)
|
||||
dot.show
|
||||
end
|
||||
|
||||
build_land
|
||||
-- Add widgets to Current
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- Initialize attributes
|
||||
land.extend (iwo_jima)
|
||||
land.extend (tinian)
|
||||
land.extend (saipan_mainland)
|
||||
land.extend (rota)
|
||||
land.extend (guam)
|
||||
land.extend (colonia)
|
||||
land.extend (palau)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at north-east point
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (36, 66))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-57, 132)) -- under Truk
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-193, 132))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-226, 95)) -- under Philippines
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-229, 68)) -- under Philippines
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-221, 20))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- local
|
||||
-- t: EV_MODEL_TRANSFORMATION
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (36, 66))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-57, 132)) -- under Truk
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-193, 132))
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (-226, 95)) -- under Philippines
|
||||
---- bounding_figure.extend_point (create {EV_COORDINATE}.make (-229, 68)) -- under Philippines
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-221, 20))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- create t.make_zero
|
||||
-- t.translate (446, 183)
|
||||
-- jj_bounding_figure.transform (t)
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
feature -- Access
|
||||
|
||||
iwo_jima: EV_MODEL_POLYGON
|
||||
tinian: EV_MODEL_POLYGON
|
||||
saipan_mainland: EV_MODEL_POLYGON
|
||||
rota: EV_MODEL_POLYGON
|
||||
guam: EV_MODEL_POLYGON
|
||||
colonia: EV_MODEL_POLYGON
|
||||
palau: EV_MODEL_POLYGON
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
iwo_jima_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1.1851851851852189, -5.3333333333333286))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0.59259259259260944, -8.8888888888888928))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-1.7777777777778283, -10.962962962962976))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (2.3703703703703241, -11.259259259259252))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (5.9259259259259807, -8.8888888888888928))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (8.296296296296191, -8.8888888888888928))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (8.296296296296191, -5.9259259259259309))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (5.6296296296296759, -5.3333333333333286))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (3.259259259259295, -2.0740740740740762))
|
||||
end
|
||||
|
||||
tinian_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (198.81481481481478, 481.48148148148147))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (198.22222222222217, 478.51851851851842))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (196.14814814814815, 477.03703703703701))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (196.14814814814815, 474.66666666666657))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (194.37037037037032, 474.66666666666657))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (194.96296296296293, 472.29629629629625))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (196.74074074074076, 468.7407407407407))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (197.92592592592587, 471.11111111111103))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (198.22222222222217, 473.48148148148147))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (200.2962962962963, 476.7407407407407))
|
||||
end
|
||||
|
||||
saipan_mainland_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (206.51851851851859, 470.22222222222211))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (202.66666666666663, 469.3333333333332))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (199.11111111111109, 466.07407407407396))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (200, 463.40740740740733))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (201.77777777777771, 460.7407407407407))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (202.96296296296293, 458.66666666666657))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (205.33333333333337, 459.85185185185179))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (205.03703703703695, 463.11111111111103))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (207.11111111111109, 464.59259259259255))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (207.11111111111109, 466.37037037037027))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (205.03703703703695, 465.48148148148147))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (205.03703703703695, 467.25925925925918))
|
||||
end
|
||||
|
||||
rota_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (175.11111111111109, 515.25925925925912))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (174.51851851851859, 512.5925925925925))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (176.8888888888888, 511.99999999999983))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (178.37037037037032, 510.51851851851842))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (181.33333333333337, 510.81481481481484))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (181.92592592592587, 512.5925925925925))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (179.85185185185185, 512.5925925925925))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (180.14814814814815, 514.07407407407391))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (177.77777777777771, 514.96296296296282))
|
||||
end
|
||||
|
||||
guam_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (160.8888888888888, 538.07407407407391))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (162.96296296296293, 536.29629629629619))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (164.74074074074076, 538.66666666666652))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (166.51851851851859, 539.25925925925912))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (165.33333333333337, 542.51851851851836))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (166.22222222222217, 546.07407407407391))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (163.85185185185185, 547.85185185185173))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (163.55555555555554, 549.92592592592587))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (159.11111111111109, 551.40740740740728))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (158.22222222222217, 553.7777777777776))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (157.62962962962968, 555.25925925925912))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (154.96296296296293, 555.55555555555543))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (153.18518518518522, 554.07407407407391))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (152.2962962962963, 551.40740740740728))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (153.77777777777771, 548.74074074074065))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (151.70370370370358, 548.44444444444434))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (153.77777777777771, 546.96296296296282))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (157.03703703703695, 545.18518518518499))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (159.70370370370358, 543.70370370370358))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (159.11111111111109, 540.44444444444434))
|
||||
end
|
||||
|
||||
colonia_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-147.25925925925921, 733.62962962962956))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-147.55555555555554, 730.66666666666652))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-146.37037037037032, 726.51851851851836))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-144.29629629629628, 725.62962962962956))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-143.11111111111109, 722.66666666666652))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-142.51851851851848, 724.74074074074053))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-140.1481481481481, 726.51851851851836))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-142.22222222222223, 728.88888888888869))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-143.70370370370367, 728.29629629629619))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-145.18518518518516, 730.37037037037021))
|
||||
end
|
||||
|
||||
palau_imp: EV_MODEL_POLYGON
|
||||
-- Make the polygon
|
||||
do
|
||||
create Result
|
||||
-- Points generated by Grabber application
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-306.37037037037032, 811.25925925925912))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-304.29629629629625, 809.7777777777776))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-303.11111111111109, 811.25925925925912))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-302.51851851851848, 813.33333333333314))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-302.51851851851848, 817.18518518518499))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-301.03703703703695, 818.37037037037021))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-302.22222222222217, 819.85185185185173))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-301.62962962962956, 823.40740740740716))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-304.29629629629625, 826.66666666666652))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-305.48148148148141, 827.85185185185173))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-308.1481481481481, 829.62962962962956))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-309.92592592592587, 831.11111111111097))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-311.40740740740733, 832.59259259259238))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-312.8888888888888, 832.88888888888869))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-313.77777777777771, 834.66666666666652))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-313.48148148148141, 837.03703703703695))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-316.4444444444444, 837.03703703703695))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-314.96296296296288, 832.59259259259238))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-312.29629629629625, 831.11111111111097))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-311.40740740740733, 828.14814814814804))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-309.03703703703695, 826.37037037037021))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-309.62962962962956, 823.70370370370358))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-310.51851851851848, 821.33333333333314))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-308.74074074074065, 821.03703703703695))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-309.03703703703695, 818.96296296296282))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-306.96296296296293, 816.29629629629619))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-304.5925925925925, 815.11111111111097))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-304.5925925925925, 812.14814814814804))
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.Marianas_islands
|
||||
|
||||
end
|
1054
jj_vitp/Interface/widgets/sea_area_widgets/marshall_islands_widget.e
Normal file
1054
jj_vitp/Interface/widgets/sea_area_widgets/marshall_islands_widget.e
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
NORTH_PACIFIC_OCEAN_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
create_interface_objects,
|
||||
position_widgets,
|
||||
build_land,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
create_interface_objects
|
||||
-- Initialize attributes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
aleutians_east := aleutians_east_imp
|
||||
end
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
translate_widget (Current, 704, 236)
|
||||
translate_widget (name_mt, -80, -110)
|
||||
translate_widget (dot, -40, -80)
|
||||
-- flag.center_on_dot (dot)
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
end
|
||||
|
||||
build_land
|
||||
-- Build the `land'
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- Initialize attributes
|
||||
land.extend (aleutians_east)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at bottom south-west corner
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-63, -2))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (-96, -105))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, -210))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-63, -2))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-96, -105))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, -210))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- translate_widget (jj_bounding_figure, 704, 236)
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
-- end
|
||||
|
||||
feature -- Access
|
||||
|
||||
aleutians_east: EV_MODEL_POLYGON
|
||||
-- The one brown island in the {NORTH_PACIFIC_OCEAN_WIDGET}.
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
aleutians_east_imp: EV_MODEL_POLYGON
|
||||
-- Create the polygon for theisland north of Australia
|
||||
|
||||
local
|
||||
t: EV_MODEL_TRANSFORMATION
|
||||
do
|
||||
create Result
|
||||
-- Start at north point
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1, 0.5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (2, 1))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (2, 5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (1.5, 5.5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (0.5, 5))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-0.5, 6))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-4, 4))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-5, 3))
|
||||
Result.extend_point (create {EV_COORDINATE}.make_precise (-7, 3))
|
||||
create t.make_zero
|
||||
t.translate (-2, -200)
|
||||
Result.transform (t)
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.north_pacific_ocean
|
||||
|
||||
end
|
367
jj_vitp/Interface/widgets/sea_area_widgets/sea_area_widget.e
Normal file
367
jj_vitp/Interface/widgets/sea_area_widgets/sea_area_widget.e
Normal file
@@ -0,0 +1,367 @@
|
||||
note
|
||||
description: "[
|
||||
Widget representing a {SEA_AREA}.
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
deferred class
|
||||
SEA_AREA_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
LOCATION_WIDGET
|
||||
rename
|
||||
location as sea_area
|
||||
redefine
|
||||
create_interface_objects,
|
||||
-- initialize,
|
||||
extend_widgets,
|
||||
build_widgets,
|
||||
set_fonts_and_colors,
|
||||
position_widgets,
|
||||
set_widget_order,
|
||||
add_actions,
|
||||
set_target,
|
||||
set_dimming_level,
|
||||
-- set_font,
|
||||
paint,
|
||||
on_button_released,
|
||||
-- on_pointer_motion,
|
||||
target_imp
|
||||
end
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
create_interface_objects
|
||||
-- Set up the widgets in Current.
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
create ships_to_mt
|
||||
create japan_poc_mt
|
||||
create allies_poc_mt
|
||||
create ocean
|
||||
create flag.make (sea_area)
|
||||
create saved_point
|
||||
end
|
||||
|
||||
extend_widgets
|
||||
-- Put widgets into Current. This cannot be done
|
||||
-- in `create_interface_object', because cannot call
|
||||
-- `extend' feature until all objects [in descendants]
|
||||
-- are also created.
|
||||
do
|
||||
text_group.extend (ships_to_mt)
|
||||
text_group.extend (japan_poc_mt)
|
||||
text_group.extend (allies_poc_mt)
|
||||
extend (ocean)
|
||||
extend (flag)
|
||||
Precursor {LOCATION_WIDGET}
|
||||
end
|
||||
|
||||
build_widgets
|
||||
-- Now that widgets were created in `create_interface_objects'
|
||||
-- and added to Current in `extend_widgets', build up the
|
||||
-- widgets by adding internal structure to each widget.
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
build_ocean
|
||||
end
|
||||
|
||||
set_fonts_and_colors
|
||||
-- Set the default fonts for any text widgets and set
|
||||
-- the default colors for any contained widgets.
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
background_color := Sea_area_color
|
||||
name_mt.set_font (Sea_area_font)
|
||||
ships_to_mt.set_font (Subtext_font)
|
||||
japan_poc_mt.set_font (POC_font)
|
||||
allies_poc_mt.set_font (POC_font)
|
||||
end
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
local
|
||||
px, py: INTEGER
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
-- Use the first point in the sea area as the reference
|
||||
-- The sea area was centered on the dot which is at 0, 0
|
||||
-- We now need to move the sea area so its reference point (the zero-zero
|
||||
-- point that was the starting point measured on the map) is at the
|
||||
-- origin instead of the `dot' at the origin.
|
||||
-- We can't really physically measure the center point of the ocean
|
||||
-- on the game board, because it is determined by the computer; there
|
||||
-- is no physical point on the actual game board that marks the center.
|
||||
check
|
||||
ocean_was_defined: ocean.point_count >= 1
|
||||
-- because of the call to `build_ocean'
|
||||
end
|
||||
px := ocean.i_th_point_x (1)
|
||||
py := ocean.i_th_point_y (1)
|
||||
translate_widget (Current, -px, -py)
|
||||
-- translate_widget (flag, 40, 180)
|
||||
-- translate_widget (text_widget, 20, 150)
|
||||
end
|
||||
|
||||
set_widget_order
|
||||
-- Ensure the widgets are ordered properly
|
||||
-- (i.e. whose on top?)
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
-- Bring all the text to front
|
||||
-- bring_to_front (name_mt)
|
||||
-- bring_to_front (ships_to_mt)
|
||||
-- bring_to_front (japan_poc_mt)
|
||||
-- bring_to_front (allies_poc_mt)
|
||||
-- Set order for other widgets
|
||||
bring_to_front (ocean)
|
||||
bring_to_front (land)
|
||||
bring_to_front (text_group)
|
||||
bring_to_front (flag)
|
||||
bring_to_front (dot)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Add defining points to the `ocean'.
|
||||
do
|
||||
end
|
||||
|
||||
add_actions
|
||||
-- Add actions to the port (really just the marker)
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
-- drop_actions.extend (agent on_drop_unit)
|
||||
flag.pointer_button_press_actions.extend (agent on_flag_pressed)
|
||||
-- pointer_button_release_actions.extend (agent on_button_released)
|
||||
-- pointer_motion_actions.extend (agent on_pointer_moved)
|
||||
jj_defining_figure.pointer_leave_actions.extend (agent on_leave_bounding_figure)
|
||||
end
|
||||
|
||||
position_text
|
||||
-- Set the position of the text inside Current
|
||||
local
|
||||
nh: REAL_64
|
||||
n_mid: REAL_64
|
||||
x_mid: REAL_64
|
||||
ax, ay: INTEGER
|
||||
d: REAL_64
|
||||
t: EV_MODEL_TRANSFORMATION
|
||||
do
|
||||
nh := name_mt.height
|
||||
ships_to_mt.set_x_y (name_mt.x, name_mt.y + name_mt.height // 2)
|
||||
japan_poc_mt.set_y (ships_to_mt.y + ships_to_mt.height)
|
||||
allies_poc_mt.set_y (ships_to_mt.y + ships_to_mt.height)
|
||||
|
||||
japan_poc_mt.set_x (name_mt.x - japan_poc_mt.width)
|
||||
allies_poc_mt.set_x (name_mt.x + allies_poc_mt.width)
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_target (a_target: like sea_area)
|
||||
-- Change the `target'.
|
||||
local
|
||||
s, s1, s2: STRING
|
||||
pos: INTEGER
|
||||
do
|
||||
Precursor {LOCATION_WIDGET} (a_target)
|
||||
flag.set_location (sea_area)
|
||||
ships_to_mt.set_text (ships_to_text)
|
||||
japan_poc_mt.set_text (japan_poc_text)
|
||||
allies_poc_mt.set_text (allies_poc_text)
|
||||
position_text
|
||||
end
|
||||
|
||||
set_dimming_level (a_level: like dimming_level)
|
||||
-- Change the `dimming_level'
|
||||
do
|
||||
Precursor {LOCATION_WIDGET} (a_level)
|
||||
flag.set_dimming_level (a_level)
|
||||
paint
|
||||
end
|
||||
|
||||
-- set_font (a_font: EV_FONT)
|
||||
-- -- Change the appearance of the `font' from which
|
||||
-- -- the fonts (height, weight, etc.) of any text
|
||||
-- -- widgets in Current can be based.
|
||||
-- local
|
||||
-- f: EV_FONT
|
||||
-- do
|
||||
-- font := a_font
|
||||
-- name_mt.set_font (font)
|
||||
-- -- Set the other text models based on `font'
|
||||
-- f := font.twin
|
||||
-- f.set_height (f.height // 2)
|
||||
-- ships_to_mt.set_font (f)
|
||||
-- f := font.twin
|
||||
-- f.set_height (f.height // 2)
|
||||
-- japan_poc_mt.set_font (f)
|
||||
-- allies_poc_mt.set_font (f)
|
||||
-- end
|
||||
|
||||
feature -- Basic operations
|
||||
|
||||
-- on_drop_unit (a_unit: ATTACK_UNIT)
|
||||
-- -- React to `a_unit' dropped into Current
|
||||
-- do
|
||||
-- io.put_string ("SEA_AREA_WIDGET.on_drop_unit: " + a_unit.name + " dropped on " + Current.sea_area.name + "%N")
|
||||
-- end
|
||||
|
||||
restore_flag_position
|
||||
-- Reset the `flag' to its default position (i.e. centered on `dot')
|
||||
do
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
end
|
||||
|
||||
paint
|
||||
-- Set the colors for all widgets in Current
|
||||
do
|
||||
Precursor {LOCATION_WIDGET}
|
||||
print ("SEA_AREA_WIDGET.paint: dimming level = " + dimming_level.out + "%N")
|
||||
ships_to_mt.set_foreground_color (adjusted_color (foreground_color))
|
||||
japan_poc_mt.set_foreground_color (adjusted_color (foreground_color))
|
||||
allies_poc_mt.set_foreground_color (adjusted_color (foreground_color))
|
||||
ocean.set_foreground_color (adjusted_color (background_color))
|
||||
ocean.set_background_color (adjusted_color (background_color))
|
||||
flag.paint
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation (actions)
|
||||
|
||||
on_flag_pressed (ax: INTEGER; ay: INTEGER; a_button: INTEGER; x_tilt: DOUBLE; y_tilt: DOUBLE;
|
||||
pressure: DOUBLE; a_screen_x: INTEGER; a_screen_y: INTEGER)
|
||||
-- The `flag' was pressed
|
||||
do
|
||||
io.put_string ("SEA_AREA_WIDGET.on_flag_pressed: button " + a_button.out + " released at (" + ax.out + ", " + ay.out + ") %N")
|
||||
is_dragging_flag := True
|
||||
saved_point.set (ax, ay)
|
||||
enable_capture
|
||||
end
|
||||
|
||||
on_button_released (ax: INTEGER; ay: INTEGER; a_button: INTEGER; x_tilt: DOUBLE; y_tilt: DOUBLE;
|
||||
pressure: DOUBLE; a_screen_x: INTEGER; a_screen_y: INTEGER)
|
||||
local
|
||||
c: detachable EV_COORDINATE
|
||||
do
|
||||
Precursor {LOCATION_WIDGET} (ax, ay, a_button, x_tilt, y_tilt, pressure, a_screen_x, a_screen_y)
|
||||
io.put_string ("SEA_AREA_WIDGET.on_button_release: button " + a_button.out + " released at (" + ax.out + ", " + ay.out + ") %N")
|
||||
-- Precursor {LOCATION_WIDGET} (ax, ay, a_button, x_tilt, y_tilt, pressure, a_screen_x, a_screen_y)
|
||||
if is_dragging_flag then
|
||||
create c.make (ax, ay)
|
||||
-- flag.center_on_point (c)
|
||||
flag.set_x_y (c.x, c.y)
|
||||
disable_capture
|
||||
end
|
||||
is_dragging_flag := False
|
||||
end
|
||||
|
||||
on_leave_bounding_figure
|
||||
-- If pointer leaves `jj_bounding_figure', then release the capture and drop the flag
|
||||
do
|
||||
if is_dragging_flag then
|
||||
-- flag.center_on_point (saved_point)
|
||||
flag.set_x_y (saved_point.x, saved_point.y)
|
||||
disable_capture
|
||||
end
|
||||
is_dragging_flag := False
|
||||
end
|
||||
|
||||
on_pointer_motion (ax: INTEGER; ay: INTEGER; x_tilt: DOUBLE; y_tilt: DOUBLE;
|
||||
pressure: DOUBLE; a_screen_x: INTEGER; a_screen_y: INTEGER)
|
||||
-- The pointer is moving
|
||||
do
|
||||
-- Precursor {LOCATION_WIDGET} (ax, ay, x_tilt, y_tilt, pressure, a_screen_x, a_screen_y)
|
||||
saved_point.set (ax, ay)
|
||||
if is_dragging_flag then
|
||||
-- flag.center_on_point (saved_point)
|
||||
flag.set_x_y (saved_point.x, saved_point.y)
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
ships_to_text: STRING
|
||||
-- The line of text that is under the sea area name, begining with "Ships to..."
|
||||
do
|
||||
Result := "Ships to (if friendly) " + adjacent_ports_text + " or any RED port"
|
||||
-- Look up the list of adjacent ports in the game graph?
|
||||
end
|
||||
|
||||
japan_poc_text: STRING
|
||||
-- The line of text for the Japanese POC
|
||||
do
|
||||
Result := "JAPAN " + sea_area.japanese_poc.out + " POC"
|
||||
end
|
||||
|
||||
allies_poc_text: STRING
|
||||
-- The line of text for the Japanese POC
|
||||
do
|
||||
Result := "ALLIES " + sea_area.allied_poc.out + " POC"
|
||||
end
|
||||
|
||||
adjacent_ports_text: STRING
|
||||
-- The names of green ports touching this sea area.
|
||||
local
|
||||
lin: LINEAR [PORT]
|
||||
i, n: INTEGER
|
||||
p: PORT
|
||||
do
|
||||
Result := ""
|
||||
lin := sea_area.adjoining_ports
|
||||
-- Count green ports
|
||||
from lin.start
|
||||
until lin.exhausted
|
||||
loop
|
||||
if attached {GREEN_PORT} lin.item then
|
||||
n := n + 1
|
||||
end
|
||||
lin.forth
|
||||
end
|
||||
from lin.start
|
||||
until lin.exhausted
|
||||
loop
|
||||
p := lin.item
|
||||
lin.forth
|
||||
if attached {GREEN_PORT} p then
|
||||
Result := Result + p.name
|
||||
i := i + 1
|
||||
if n >= 3 and i < n then
|
||||
Result := Result + ", "
|
||||
elseif n >= 2 and i < n then
|
||||
Result := Result + " or "
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
ships_to_mt: EV_MODEL_TEXT
|
||||
-- Displays the "Ships to ..." text
|
||||
|
||||
japan_poc_mt: EV_MODEL_TEXT
|
||||
-- Displays the Japanese poc text
|
||||
|
||||
allies_poc_mt: EV_MODEL_TEXT
|
||||
-- Displays the Allies poc text
|
||||
|
||||
ocean: EV_MODEL_POLYGON
|
||||
-- To draw the blue sea
|
||||
|
||||
flag: FLAG
|
||||
-- The control marker for this sea area
|
||||
|
||||
is_dragging_flag: BOOLEAN
|
||||
-- Is the `flag' being moved?
|
||||
|
||||
saved_point: EV_COORDINATE
|
||||
-- The location withing Currenty to where the mouse last moved
|
||||
|
||||
target_imp: detachable SEA_AREA
|
||||
-- Anchor for the `target' represented by Current
|
||||
|
||||
invariant
|
||||
|
||||
end
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
note
|
||||
description: "[
|
||||
Widget that represents this VITP sea area
|
||||
]"
|
||||
author: "Jimmy J. Johnson"
|
||||
|
||||
class
|
||||
US_MANDATE_WIDGET
|
||||
|
||||
inherit
|
||||
|
||||
SEA_AREA_WIDGET
|
||||
redefine
|
||||
position_widgets,
|
||||
build_ocean
|
||||
-- build_bounding_figure
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
position_widgets
|
||||
-- Move Current and contained widgets to correct
|
||||
-- location and set their their sizes
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
translate_widget (Current, 449, 553)
|
||||
translate_widget (name_mt, 50, -95)
|
||||
translate_widget (dot, 70, -70)
|
||||
-- flag.center_on_dot (dot)
|
||||
flag.set_x_y (dot.x, dot.y)
|
||||
translate_widget (dot, 40, -40)
|
||||
end
|
||||
|
||||
build_ocean
|
||||
-- Create the polygon representing the `ocean' here
|
||||
-- Redefined to add the points
|
||||
do
|
||||
Precursor {SEA_AREA_WIDGET}
|
||||
-- start at bottom south-west corner
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (5, -112))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (77, -116)) -- y ~116
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (104, -164))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (255, -69))
|
||||
ocean.extend_point (create {EV_COORDINATE}.make (255, 0))
|
||||
end
|
||||
|
||||
-- build_bounding_figure
|
||||
-- -- Add points to the `jj_bounding_figure'.
|
||||
-- -- Redefined to use the tile edges as the bounding area
|
||||
-- local
|
||||
-- t: EV_MODEL_TRANSFORMATION
|
||||
-- do
|
||||
-- if has (jj_bounding_figure) then
|
||||
-- prune_all (jj_bounding_figure)
|
||||
-- end
|
||||
-- create jj_bounding_figure
|
||||
-- extend (jj_bounding_figure)
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (5, -112))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (77, -116)) -- y ~116
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (104, -164))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (255, -69))
|
||||
-- jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (255, 0))
|
||||
-- jj_bounding_figure.enable_closed
|
||||
-- create t.make_zero
|
||||
-- t.translate (449, 553) -- 553 is the board height (not including black boarder)
|
||||
-- jj_bounding_figure.transform (t)
|
||||
-- jj_bounding_figure.set_line_width (2)
|
||||
---- show_bounding_figure
|
||||
-- end
|
||||
|
||||
invariant
|
||||
|
||||
is_valid_sea_area: attached target_imp implies sea_area = game.us_mandate
|
||||
no_land: land.is_empty
|
||||
|
||||
end
|
Reference in New Issue
Block a user