-
Notifications
You must be signed in to change notification settings - Fork 0
/
coords.ads
30 lines (23 loc) · 804 Bytes
/
coords.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
with Card_Dir;
use Card_Dir;
package Coords is
type Coord is private;
function Get_X(This : Coord) return Integer;
function Get_Y(This : Coord) return Integer;
procedure Set_X(This : in out Coord;
New_X : in Integer);
procedure Set_Y(This : in out Coord;
New_Y : in Integer);
function Get_Distance(This : Coord; That: Coord) return Integer;
procedure Change_Direction(This : in out Coord;
Dir : in Cardinal_Direction);
generic
type Item is private;
type Map is array(Integer, Integer) of Item;
function Coord_With_Array(This : Coord; From : Map) return Item;
private
type Coord is record
X : Integer;
Y : Integer;
end record;
end Coords;