19928/jj_vitp/Implementation/support/cell_distance_tuple.e
Jocelyn Fiat 6dde6425c2 init
2024-06-17 09:09:33 +02:00

50 lines
984 B
Plaintext

note
description: "[
A {VITP_CELL} paired with a hammond distance, used by
{VITP_GRID} to order cells based on their distances from
a particulation location.
]"
author: "Jimmy J. Johnson"
date: "4/11/24"
copyright: "Copyright (c) 2024, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
class
CELL_DISTANCE_TUPLE
inherit
COMPARABLE
create
make
feature {NONE} -- Initialization
make (a_cell: VITP_CELL; a_distance: INTEGER)
-- Create an instance
do
cell := a_cell
distance := a_distance
end
feature -- Access
cell: VITP_CELL
-- The cell
distance: INTEGER
-- The hammond distance (computed elsewhere) to which
-- a `cell' is paired.
feature -- Comparison
is_less alias "<" (other: like Current): BOOLEAN
-- Is current object less than `other'?
do
Result := (distance < other.distance) or else
(distance = other.distance and cell.position < other.cell.position)
end
end