note
	description: "[
		A {PORT} in {VITP_GAME} which [possibly] has repair capability.
		]"
	author:    "Jimmy J. Johnson"
	date:      "11/11/23"
	copyright: "Copyright (c) 2021, Jimmy J. Johnson"
	license:   "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"

deferred class
	REPAIR_PORT

inherit

	PORT
		redefine
			make
		end

feature {NONE} -- Initialization

	make (a_game: like game)
			-- Initialize Current
		do
			Precursor (a_game)
			create dry_dock.make (0)
		end

feature -- Access

	repair_points: INTEGER
			-- Number of repair points available at this port
		deferred
		end

	repair_points_used: INTEGER
			-- Total repair points assigned to ships
		do
			from dry_dock.start
			until dry_dock.after
			loop
				Result := Result + dry_dock.item.points
				dry_dock.forth
			end
		end

feature {NONE} -- Implementation

	dry_dock: ARRAYED_LIST [TUPLE [ship: SHIP; points: INTEGER]]
			-- Contains the ships to be repaired along with the repair
			-- points assigned to that ship on this turn.


invariant

	repair_points_not_exceeded: repair_points_used <= repair_points

end
