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
