note
	description: "[
		One of the classes that decompose the numourous VITP widgets 
		into more managable groups containing the Japanese-unit widgets.
		]"
	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
	JAPANESE_FORCES_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
			print ("JAPANESE_FORCES_WIDGET_FACTORY.make_widgets %N")
			Precursor {WIDGET_FACTORY}
			print ("%T  JAPANESE_FORCES_WIDGET_FACTORY.make_widgets   after Precursor call %N")
			create japanese_forces_widgets.make (100)
			print ("%T  JAPANESE_FORCES_WIDGET_FACTORY.make_widgets   after create japanese_forces_widgets %N")
				-- Turn 1
			check attached game then
				print ("%T  JAPANESE_FORCES_WIDGET_FACTORY.make_widgets   check statement %N")
				print ("%T  JAPANESE_FORCES_WIDGET_FACTORY.make_widgets   " + game.shokaku.name + "%N")

			end
			create shokaku_widget.make (game.shokaku)
			print ("%T  JAPANESE_FORCES_WIDGET_FACTORY.make_widgets   after create shokaku_widget %N")
			create zuikaku_widget.make (game.zuikaku)
			create akagi_widget.make (game.akagi)
			create kaga_widget.make (game.kaga)
			create soryu_widget.make (game.soryu)
			create hiryu_widget.make (game.hiryu)
			create ryujo_widget.make (game.ryujo)
			create hosho_widget.make (game.hosho)
			create zuiho_widget.make (game.zuiho)
			create mutsu_widget.make (game.mutsu)
			create nagato_widget.make (game.nagato)
			create fuso_widget.make (game.fuso)
			create hyuga_widget.make (game.hyuga)
			create ise_widget.make (game.ise)
			create yamashiro_widget.make (game.yamashiro)
			create haruna_widget.make (game.haruna)
			create hiei_widget.make (game.hiei)
			create kirishima_widget.make (game.kirishima)
			create kongo_widget.make (game.kongo)
			create ashigara_widget.make (game.ashigara)
			create atago_widget.make (game.atago)
			create chokai_widget.make (game.chokai)
			create haguro_widget.make (game.haguro)
			create maya_widget.make (game.maya)
			create myoko_widget.make (game.myoko)
			create nachi_widget.make (game.nachi)
			create takao_widget.make (game.takao)
			create chikuma_widget.make (game.chikuma)
			create kumano_widget.make (game.kumano)
			create mikuma_widget.make (game.mikuma)
			create mogami_widget.make (game.mogami)
			create suzuya_widget.make (game.suzuya)
			create tone_widget.make (game.tone)
			create aoba_widget.make (game.aoba)
			create furutaka_widget.make (game.furutaka)
			create kako_widget.make (game.kako)
			create kinugasa_widget.make (game.kinugasa)
			create kitakami_widget.make (game.kitakami)
			create oi_widget.make (game.oi)
			create yokosuka_widget.make (game.yokosuka)
			create airflot_21_widget.make (game.airflot_21)
			create airflot_22_widget.make (game.airflot_22)
			create airflot_23_widget.make (game.airflot_23)
			create airflot_24_widget.make (game.airflot_24)
			create airflot_25_widget.make (game.airflot_25)
			create airflot_26_widget.make (game.airflot_26)
			create i_boat_widget.make (game.i_boat)
				-- Turn 2
			create shoho_widget.make (game.shoho)
			create junyo_widget.make (game.junyo)
			create sasebo_widget.make (game.sasebo)
				-- Turn 3
			create hiyo_widget.make (game.hiyo)
			create yamato_widget.make (game.yamato)
			create kure_widget.make (game.kure)
				-- Turn 4
			do_nothing
				-- Turn 5
			create musashi_widget.make (game.musashi)
				-- Turn 6
			do_nothing
				-- Turn 7
			create chiyoda_widget.make (game.chiyoda)
			create chitose_widget.make (game.chitose)
			create ryuho_widget.make (game.ryuho)
			create taiho_widget.make (game.taiho)
			create i_boat_removal_widget.make (game.i_boat_removal)
				-- Turn 8
			create unryu_widget.make (game.unryu)
			create amagi_widget.make (game.amagi)
				-- Turn 9
			create katsuragi_widget.make (game.katsuragi)
			create shinano_widget.make (game.shinano)
		end

feature -- Access (tables)

	japanese_forces_widgets: VITP_WIDGET_TABLE [ATTACK_UNIT_WIDGET, ATTACK_UNIT]
			-- Keeps track of widgets

feature -- Access (Japanese unit widgets)

		-- Turn 1, row 1
	shokaku_widget: SHIP_WIDGET
	zuikaku_widget: SHIP_WIDGET
	akagi_widget: SHIP_WIDGET
	kaga_widget: SHIP_WIDGET
	soryu_widget: SHIP_WIDGET
	hiryu_widget: SHIP_WIDGET
	ryujo_widget: SHIP_WIDGET
	hosho_widget: SHIP_WIDGET
	zuiho_widget: SHIP_WIDGET
	mutsu_widget: SHIP_WIDGET
	nagato_widget: SHIP_WIDGET
	fuso_widget: SHIP_WIDGET
		-- Turn 1, row 2
	hyuga_widget: SHIP_WIDGET
	ise_widget: SHIP_WIDGET
	yamashiro_widget: SHIP_WIDGET
	haruna_widget: SHIP_WIDGET
	hiei_widget: SHIP_WIDGET
	kirishima_widget: SHIP_WIDGET
	kongo_widget: SHIP_WIDGET
	ashigara_widget: SHIP_WIDGET
	atago_widget: SHIP_WIDGET
	chokai_widget: SHIP_WIDGET
	haguro_widget: SHIP_WIDGET
	maya_widget: SHIP_WIDGET
		-- Turn 1, row 3
	myoko_widget: SHIP_WIDGET
	nachi_widget: SHIP_WIDGET
	takao_widget: SHIP_WIDGET
	chikuma_widget: SHIP_WIDGET
	kumano_widget: SHIP_WIDGET
	mikuma_widget: SHIP_WIDGET
	mogami_widget: SHIP_WIDGET
	suzuya_widget: SHIP_WIDGET
	tone_widget: SHIP_WIDGET
	aoba_widget: SHIP_WIDGET
	furutaka_widget: SHIP_WIDGET
	kako_widget: SHIP_WIDGET
		-- Turn 1, row 4
	kinugasa_widget: SHIP_WIDGET
	kitakami_widget: SHIP_WIDGET
	oi_widget: SHIP_WIDGET
	yokosuka_widget: AMPHIBIOUS_UNIT_WIDGET
		-- Turn 1, also available
	airflot_21_widget: JAPANESE_AIR_UNIT_WIDGET
	airflot_22_widget: JAPANESE_AIR_UNIT_WIDGET
	airflot_23_widget: JAPANESE_AIR_UNIT_WIDGET
	airflot_24_widget: JAPANESE_AIR_UNIT_WIDGET
	airflot_25_widget: JAPANESE_AIR_UNIT_WIDGET
	airflot_26_widget: JAPANESE_AIR_UNIT_WIDGET
	i_boat_widget: SUBMARINE_WIDGET
		-- Turn 2
	shoho_widget: SHIP_WIDGET
	junyo_widget: SHIP_WIDGET
	sasebo_widget: AMPHIBIOUS_UNIT_WIDGET
		-- Turn 3
	hiyo_widget: SHIP_WIDGET
	yamato_widget: SHIP_WIDGET
	kure_widget: AMPHIBIOUS_UNIT_WIDGET
		-- Turn 5
	musashi_widget: SHIP_WIDGET
		-- Turn 7
	chiyoda_widget: SHIP_WIDGET
	chitose_widget: SHIP_WIDGET
	ryuho_widget: SHIP_WIDGET
	taiho_widget: SHIP_WIDGET
	i_boat_removal_widget: SUBMARINE_WIDGET
		-- Turn 8
	unryu_widget: SHIP_WIDGET
	amagi_widget: SHIP_WIDGET
		-- Turn 9
	katsuragi_widget: SHIP_WIDGET
	shinano_widget: SHIP_WIDGET

feature {NONE} -- Implementation

	extend_widgets
			-- Put each widget into `world'.
		do
				-- Turn 1, row 1
			japanese_forces_widgets.extend (shokaku_widget, game.shokaku)
			japanese_forces_widgets.extend (zuikaku_widget, game.zuikaku)
			japanese_forces_widgets.extend (akagi_widget, game.akagi)
			japanese_forces_widgets.extend (kaga_widget, game.kaga)
			japanese_forces_widgets.extend (soryu_widget, game.soryu)
			japanese_forces_widgets.extend (hiryu_widget, game.hiryu)
			japanese_forces_widgets.extend (ryujo_widget, game.ryujo)
			japanese_forces_widgets.extend (hosho_widget, game.hosho)
			japanese_forces_widgets.extend (zuiho_widget, game.zuiho)
			japanese_forces_widgets.extend (mutsu_widget, game.mutsu)
			japanese_forces_widgets.extend (nagato_widget, game.nagato)
			japanese_forces_widgets.extend (fuso_widget, game.fuso)
				-- Turn 1, row 2
			japanese_forces_widgets.extend (hyuga_widget, game.hyuga)
			japanese_forces_widgets.extend (ise_widget, game.ise)
			japanese_forces_widgets.extend (yamashiro_widget, game.yamashiro)
			japanese_forces_widgets.extend (haruna_widget, game.haruna)
			japanese_forces_widgets.extend (hiei_widget, game.hiei)
			japanese_forces_widgets.extend (kirishima_widget, game.kirishima)
			japanese_forces_widgets.extend (kongo_widget, game.kongo)
			japanese_forces_widgets.extend (ashigara_widget, game.ashigara)
			japanese_forces_widgets.extend (atago_widget, game.atago)
			japanese_forces_widgets.extend (chokai_widget, game.chokai)
			japanese_forces_widgets.extend (haguro_widget, game.haguro)
			japanese_forces_widgets.extend (maya_widget, game.maya)
				-- Turn 1, row 3
			japanese_forces_widgets.extend (myoko_widget, game.myoko)
			japanese_forces_widgets.extend (nachi_widget, game.nachi)
			japanese_forces_widgets.extend (takao_widget, game.takao)
			japanese_forces_widgets.extend (chikuma_widget, game.chikuma)
			japanese_forces_widgets.extend (kumano_widget, game.kumano)
			japanese_forces_widgets.extend (mikuma_widget, game.mikuma)
			japanese_forces_widgets.extend (mogami_widget, game.mogami)
			japanese_forces_widgets.extend (suzuya_widget, game.suzuya)
			japanese_forces_widgets.extend (tone_widget, game.tone)
			japanese_forces_widgets.extend (aoba_widget, game.aoba)
			japanese_forces_widgets.extend (furutaka_widget, game.furutaka)
			japanese_forces_widgets.extend (kako_widget, game.kako)
				-- Turn 1, row 4
			japanese_forces_widgets.extend (kinugasa_widget, game.kinugasa)
			japanese_forces_widgets.extend (kitakami_widget, game.kitakami)
			japanese_forces_widgets.extend (oi_widget, game.oi)
			japanese_forces_widgets.extend (yokosuka_widget, game.yokosuka)
				-- Turn 1, also available
			japanese_forces_widgets.extend (airflot_21_widget, game.airflot_21)
			japanese_forces_widgets.extend (airflot_22_widget, game.airflot_22)
			japanese_forces_widgets.extend (airflot_23_widget, game.airflot_23)
			japanese_forces_widgets.extend (airflot_24_widget, game.airflot_24)
			japanese_forces_widgets.extend (airflot_25_widget, game.airflot_25)
			japanese_forces_widgets.extend (airflot_26_widget, game.airflot_26)
			japanese_forces_widgets.extend (i_boat_widget, game.i_boat)
				-- Turn 2
			japanese_forces_widgets.extend (shoho_widget, game.shoho)
			japanese_forces_widgets.extend (junyo_widget, game.junyo)
			japanese_forces_widgets.extend (sasebo_widget, game.sasebo)
				-- Turn 3
			japanese_forces_widgets.extend (hiyo_widget, game.hiyo)
			japanese_forces_widgets.extend (yamato_widget, game.yamato)
			japanese_forces_widgets.extend (kure_widget, game.kure)
				-- Turn 5
			japanese_forces_widgets.extend (musashi_widget, game.musashi)
				-- Turn 7
			japanese_forces_widgets.extend (chiyoda_widget, game.chiyoda)
			japanese_forces_widgets.extend (chitose_widget, game.chitose)
			japanese_forces_widgets.extend (ryuho_widget, game.ryuho)
			japanese_forces_widgets.extend (taiho_widget, game.taiho)
				-- Turn 8
			japanese_forces_widgets.extend (unryu_widget, game.unryu)
			japanese_forces_widgets.extend (amagi_widget, game.amagi)
				-- Turn 9
			japanese_forces_widgets.extend (katsuragi_widget, game.katsuragi)
			japanese_forces_widgets.extend (shinano_widget, game.shinano)
			widgets.merge (japanese_forces_widgets)
		end

	pair_widgets
			-- Associate each widget with a unit
		do
				-- Turn 1, row 1
			japanese_forces_widgets.force (shokaku_widget, game.shokaku)
			japanese_forces_widgets.force (zuikaku_widget, game.zuikaku)
			japanese_forces_widgets.force (akagi_widget, game.akagi)
			japanese_forces_widgets.force (kaga_widget, game.kaga)
			japanese_forces_widgets.force (soryu_widget, game.soryu)
			japanese_forces_widgets.force (hiryu_widget, game.hiryu)
			japanese_forces_widgets.force (ryujo_widget, game.ryujo)
			japanese_forces_widgets.force (hosho_widget, game.hosho)
			japanese_forces_widgets.force (zuiho_widget, game.zuiho)
			japanese_forces_widgets.force (mutsu_widget, game.mutsu)
			japanese_forces_widgets.force (nagato_widget, game.nagato)
			japanese_forces_widgets.force (fuso_widget, game.fuso)
				-- Turn 1, row 2
			japanese_forces_widgets.force (hyuga_widget, game.hyuga)
			japanese_forces_widgets.force (ise_widget, game.ise)
			japanese_forces_widgets.force (yamashiro_widget, game.yamashiro)
			japanese_forces_widgets.force (haruna_widget, game.haruna)
			japanese_forces_widgets.force (hiei_widget, game.hiei)
			japanese_forces_widgets.force (kirishima_widget, game.kirishima)
			japanese_forces_widgets.force (kongo_widget, game.kongo)
			japanese_forces_widgets.force (ashigara_widget, game.ashigara)
			japanese_forces_widgets.force (atago_widget, game.atago)
			japanese_forces_widgets.force (chokai_widget, game.chokai)
			japanese_forces_widgets.force (haguro_widget, game.haguro)
			japanese_forces_widgets.force (maya_widget, game.maya)
				-- Turn 1, row 3
			japanese_forces_widgets.force (myoko_widget, game.myoko)
			japanese_forces_widgets.force (nachi_widget, game.nachi)
			japanese_forces_widgets.force (takao_widget, game.takao)
			japanese_forces_widgets.force (chikuma_widget, game.chikuma)
			japanese_forces_widgets.force (kumano_widget, game.kumano)
			japanese_forces_widgets.force (mikuma_widget, game.mikuma)
			japanese_forces_widgets.force (mogami_widget, game.mogami)
			japanese_forces_widgets.force (suzuya_widget, game.suzuya)
			japanese_forces_widgets.force (tone_widget, game.tone)
			japanese_forces_widgets.force (aoba_widget, game.aoba)
			japanese_forces_widgets.force (furutaka_widget, game.furutaka)
			japanese_forces_widgets.force (kako_widget, game.kako)
				-- Turn 1, row 4
			japanese_forces_widgets.force (kinugasa_widget, game.kinugasa)
			japanese_forces_widgets.force (kitakami_widget, game.kitakami)
			japanese_forces_widgets.force (oi_widget, game.oi)
			japanese_forces_widgets.force (yokosuka_widget, game.yokosuka)
				-- Turn 1, also available
			japanese_forces_widgets.force (airflot_21_widget, game.airflot_21)
			japanese_forces_widgets.force (airflot_22_widget, game.airflot_22)
			japanese_forces_widgets.force (airflot_23_widget, game.airflot_23)
			japanese_forces_widgets.force (airflot_24_widget, game.airflot_24)
			japanese_forces_widgets.force (airflot_25_widget, game.airflot_25)
			japanese_forces_widgets.force (airflot_26_widget, game.airflot_26)
			japanese_forces_widgets.force (i_boat_widget, game.i_boat)
				-- Turn 2
			japanese_forces_widgets.force (shoho_widget, game.shoho)
			japanese_forces_widgets.force (junyo_widget, game.junyo)
			japanese_forces_widgets.force (sasebo_widget, game.sasebo)
				-- Turn 3
			japanese_forces_widgets.force (hiyo_widget, game.hiyo)
			japanese_forces_widgets.force (yamato_widget, game.yamato)
			japanese_forces_widgets.force (kure_widget, game.kure)
				-- Turn 5
			japanese_forces_widgets.force (musashi_widget, game.musashi)
				-- Turn 7
			japanese_forces_widgets.force (chiyoda_widget, game.chiyoda)
			japanese_forces_widgets.force (chitose_widget, game.chitose)
			japanese_forces_widgets.force (ryuho_widget, game.ryuho)
			japanese_forces_widgets.force (taiho_widget, game.taiho)
				-- Turn 8
			japanese_forces_widgets.force (unryu_widget, game.unryu)
			japanese_forces_widgets.force (amagi_widget, game.amagi)
				-- Turn 9
			japanese_forces_widgets.force (katsuragi_widget, game.katsuragi)
			japanese_forces_widgets.force (shinano_widget, game.shinano)
		end

	fill_widgets
			-- Call `set_target' to give each widget a target.
		do
		-- Turn 1, row 1
			shokaku_widget.set_target (game.shokaku)
			zuikaku_widget.set_target (game.zuikaku)
			akagi_widget.set_target (game.akagi)
			kaga_widget.set_target (game.kaga)
			soryu_widget.set_target (game.soryu)
			hiryu_widget.set_target (game.hiryu)
			ryujo_widget.set_target (game.ryujo)
			hosho_widget.set_target (game.hosho)
			zuiho_widget.set_target (game.zuiho)
			mutsu_widget.set_target (game.mutsu)
			nagato_widget.set_target (game.nagato)
			fuso_widget.set_target (game.fuso)
				-- Turn 1, row 2
			hyuga_widget.set_target (game.hyuga)
			ise_widget.set_target (game.ise)
			yamashiro_widget.set_target (game.yamashiro)
			haruna_widget.set_target (game.haruna)
			hiei_widget.set_target (game.hiei)
			kirishima_widget.set_target (game.kirishima)
			kongo_widget.set_target (game.kongo)
			ashigara_widget.set_target (game.ashigara)
			atago_widget.set_target (game.atago)
			chokai_widget.set_target (game.chokai)
			haguro_widget.set_target (game.haguro)
			maya_widget.set_target (game.maya)
				-- Turn 1, row 3
			myoko_widget.set_target (game.myoko)
			nachi_widget.set_target (game.nachi)
			takao_widget.set_target (game.takao)
			chikuma_widget.set_target (game.chikuma)
			kumano_widget.set_target (game.kumano)
			mikuma_widget.set_target (game.mikuma)
			mogami_widget.set_target (game.mogami)
			suzuya_widget.set_target (game.suzuya)
			tone_widget.set_target (game.tone)
			aoba_widget.set_target (game.aoba)
			furutaka_widget.set_target (game.furutaka)
			kako_widget.set_target (game.kako)
				-- Turn 1, row 4
			kinugasa_widget.set_target (game.kinugasa)
			kitakami_widget.set_target (game.kitakami)
			oi_widget.set_target (game.oi)
			yokosuka_widget.set_target (game.yokosuka)
				-- Turn 1, also available
			airflot_21_widget.set_target (game.airflot_21)
			airflot_22_widget.set_target (game.airflot_22)
			airflot_23_widget.set_target (game.airflot_23)
			airflot_24_widget.set_target (game.airflot_24)
			airflot_25_widget.set_target (game.airflot_25)
			airflot_26_widget.set_target (game.airflot_26)
			i_boat_widget.set_target (game.i_boat)
				-- Turn 2
			shoho_widget.set_target (game.shoho)
			junyo_widget.set_target (game.junyo)
			sasebo_widget.set_target (game.sasebo)
				-- Turn 3
			hiyo_widget.set_target (game.hiyo)
			yamato_widget.set_target (game.yamato)
			kure_widget.set_target (game.kure)
				-- Turn 5
			musashi_widget.set_target (game.musashi)
				-- Turn 7
			chiyoda_widget.set_target (game.chiyoda)
			chitose_widget.set_target (game.chitose)
			ryuho_widget.set_target (game.ryuho)
			taiho_widget.set_target (game.taiho)
			i_boat_removal_widget.set_target (game.i_boat_removal)
				-- Turn 8
			unryu_widget.set_target (game.unryu)
			amagi_widget.set_target (game.amagi)
				-- Turn 9
			katsuragi_widget.set_target (game.katsuragi)
			shinano_widget.set_target (game.shinano)
		end

end
