19928/jj_vitp/Interface/views/sea_areas_factory.e
Jocelyn Fiat 6dde6425c2 init
2024-06-17 09:09:33 +02:00

130 lines
5.1 KiB
Plaintext

note
description: "[
One of the classes that decompose the numourous VITP widgets
into more managable groups. This class models the widgets
that contain the sea areas.
]"
author: "Jimmy J. Johnson"
date: "5/15/24"
copyright: "Copyright (c) 2024, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
class
SEA_AREAS_FACTORY
inherit
WIDGET_FACTORY
redefine
make_widgets,
extend_widgets,
pair_widgets,
fill_widgets
end
create
make
feature {NONE} -- Initialization
make_widgets
-- Create widgets for the corresponding game item
do
Precursor {WIDGET_FACTORY}
create sea_area_widgets.make (100)
-- Create widgets
create aleutian_islands_widget.make (game.aleutian_islands)
create bay_of_bengal_widget.make (game.bay_of_bengal)
create central_pacific_ocean_widget.make (game.central_pacific_ocean)
create coral_sea_widget.make (game.coral_sea)
create hawaiian_islands_widget.make (game.hawaiian_islands)
create indian_ocean_widget.make (game.indian_ocean)
create indonesia_widget.make (game.indonesia)
create japanese_islands_widget.make (game.japanese_islands)
create marianas_islands_widget.make (game.marianas_islands)
create marshall_islands_widget.make (game.marshall_islands)
create north_pacific_ocean_widget.make (game.north_pacific_ocean)
create south_pacific_ocean_widget.make (game.south_pacific_ocean)
create us_mandate_widget.make (game.us_mandate)
end
feature -- Access (tables)
sea_area_widgets: VITP_WIDGET_TABLE [SEA_AREA_WIDGET, SEA_AREA]
-- Keeps track of sea-area widgets
feature -- Access (sea area widgets)
aleutian_islands_widget: ALEUTIAN_ISLANDS_WIDGET
bay_of_bengal_widget: BAY_OF_BENGAL_WIDGET
central_pacific_ocean_widget: CENTRAL_PACIFIC_OCEAN_WIDGET
coral_sea_widget: CORAL_SEA_WIDGET
hawaiian_islands_widget: HAWAIIAN_ISLANDS_WIDGET
indian_ocean_widget: INDIAN_OCEAN_WIDGET
indonesia_widget: INDONESIA_WIDGET
japanese_islands_widget: JAPANESE_ISLANDS_WIDGET
marianas_islands_widget: MARIANAS_ISLANDS_WIDGET
marshall_islands_widget: MARSHALL_ISLANDS_WIDGET
north_pacific_ocean_widget: NORTH_PACIFIC_OCEAN_WIDGET
south_pacific_ocean_widget: SOUTH_PACIFIC_OCEAN_WIDGET
us_mandate_widget: US_MANDATE_WIDGET
feature {NONE} -- Implementation
extend_widgets
-- Put each widget into `world'
do
sea_area_widgets.extend (aleutian_islands_widget, game.aleutian_islands)
sea_area_widgets.extend (bay_of_bengal_widget, game.bay_of_bengal)
sea_area_widgets.extend (central_pacific_ocean_widget, game.central_pacific_ocean)
sea_area_widgets.extend (coral_sea_widget, game.coral_sea)
sea_area_widgets.extend (hawaiian_islands_widget, game.hawaiian_islands)
sea_area_widgets.extend (indian_ocean_widget, game.indian_ocean)
sea_area_widgets.extend (indonesia_widget, game.indonesia)
sea_area_widgets.extend (japanese_islands_widget, game.japanese_islands)
sea_area_widgets.extend (marianas_islands_widget, game.marianas_islands)
sea_area_widgets.extend (marshall_islands_widget, game.marshall_islands)
sea_area_widgets.extend (north_pacific_ocean_widget, game.north_pacific_ocean)
sea_area_widgets.extend (south_pacific_ocean_widget, game.south_pacific_ocean)
sea_area_widgets.extend (us_mandate_widget, game.us_mandate)
widgets.merge (sea_area_widgets)
end
pair_widgets
-- Associate each widget with a sea area
do
sea_area_widgets.force (aleutian_islands_widget, game.aleutian_islands)
sea_area_widgets.force (bay_of_bengal_widget, game.bay_of_bengal)
sea_area_widgets.force (central_pacific_ocean_widget, game.central_pacific_ocean)
sea_area_widgets.force (coral_sea_widget, game.coral_sea)
sea_area_widgets.force (hawaiian_islands_widget, game.hawaiian_islands)
sea_area_widgets.force (indian_ocean_widget, game.indian_ocean)
sea_area_widgets.force (indonesia_widget, game.indonesia)
sea_area_widgets.force (japanese_islands_widget, game.japanese_islands)
sea_area_widgets.force (marianas_islands_widget, game.marianas_islands)
sea_area_widgets.force (marshall_islands_widget, game.marshall_islands)
sea_area_widgets.force (north_pacific_ocean_widget, game.north_pacific_ocean)
sea_area_widgets.force (south_pacific_ocean_widget, game.south_pacific_ocean)
sea_area_widgets.force (us_mandate_widget, game.us_mandate)
end
fill_widgets
-- Call `set_target' to give each widget a target
do
aleutian_islands_widget.set_target (game.aleutian_islands)
bay_of_bengal_widget.set_target (game.bay_of_bengal)
central_pacific_ocean_widget.set_target (game.central_pacific_ocean)
coral_sea_widget.set_target (game.coral_sea)
hawaiian_islands_widget.set_target (game.hawaiian_islands)
indian_ocean_widget.set_target (game.indian_ocean)
indonesia_widget.set_target (game.indonesia)
japanese_islands_widget.set_target (game.japanese_islands)
marianas_islands_widget.set_target (game.marianas_islands)
marshall_islands_widget.set_target (game.marshall_islands)
north_pacific_ocean_widget.set_target (game.north_pacific_ocean)
south_pacific_ocean_widget.set_target (game.south_pacific_ocean)
us_mandate_widget.set_target (game.us_mandate)
end
end