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
