note
	description: "[
		An {ATTACK_UNIT} that belongs to the Japanese.
		]"
	author:    "Jimmy J. Johnson"
	date:      "5/12/24"
	copyright: "Copyright (c) 2024, Jimmy J. Johnson"
	license:   "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"

deferred class
	JAPANESE_UNIT

inherit

	ATTACK_UNIT
		redefine
			make
		end

feature {NONE} -- Initialization

	make (a_game: like game)
			-- Initialize attributes of Current
		do
			PRECURSOR {ATTACK_UNIT} (a_game)
			nationality := game.japanese
		end

feature -- Access

	reinforceable_ports: LINKED_SET [PORT]
			-- A list containing each {PORT} to which Current
			-- can be moved during the reinforcement step.
		local
			sop: VITP_SEQUENCE_OF_PLAY
			mp: VITP_TABLE [RED_PORT]
		do
--			io.put_string ("ALLIED_UNIT.reinforceable_ports: %N")
			create Result.make
			mp := game.major_ports
			from mp.start
			until mp.after
			loop
				if mp.item_for_iteration.is_japanese then
					Result.extend (mp.item_for_iteration)
				end
				mp.forth
			end
		end

invariant

	is_japanese: nationality = game.japanese

end
