-
Notifications
You must be signed in to change notification settings - Fork 0
/
waypoints.ads
107 lines (80 loc) · 2.73 KB
/
waypoints.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
-- File name : waypoints.ads
-- Purpose : Project 2 Final Submission Waypoints Specification
-- Author : erl
-- Course : CS301
-- Hour/section : G4
package Waypoints is
type Threat_Code is
(Unknown,
Green,
Amber,
Red);
type File_Control is --used for paths.txt I/O
(Beginpath,
Beginpoint,
Endpoint,
Endpath);
subtype Name_String is String (1 .. 10); --name of waypoint
subtype Map_Range is Integer range 100..999; --range of map coordinates
subtype Choice is Positive range 1..2; --which point search type
type Waypoint;
type Way_Ptr is access Waypoint;
type Waypoint is
record
Xcor : Map_Range := Map_Range'First;
Ycor : Map_Range := Map_Range'First;
Next : Way_Ptr := null;
end record;
type Map_Point is
record
Name : Name_String := (others => ' ');
Threat_Level : Threat_Code := Unknown;
end record;
type Maparray is array (Map_Range, Map_Range) of Map_Point;
Map : Maparray;
type Headarray is array (1 .. 8) of Way_Ptr;
Head : Headarray := (others => null);
function Get_A_Coord (
Xory : in Choice )
return Map_Range;
function Enter_Data_Type return Choice;
function Enter_Threat_Code return Threat_Code;
function Enter_Waypoint_Name return Name_String;
procedure Find_Coordinates (
Map : in Maparray;
Instring : in out Name_String;
Xcor,
Ycor : out Map_Range );
procedure Enter_Data (
Map : in Maparray;
Xcor,
Ycor : out Map_Range;
Instring : out Name_String );
procedure Create_New_Path (
Head : in out Headarray;
Map : in out Maparray );
procedure Shortest_Path (
Head : in Headarray;
Map : in Maparray );
procedure Safest_Path (
Head : in Headarray;
Map : in Maparray );
procedure Add_Waypoint (
Map : in out Maparray;
Head : in out Headarray );
procedure Remove_Waypoint (
Head : in out Headarray;
Map : in out Maparray );
procedure Change_Threat_Code (
Head : in Headarray;
Map : in out Maparray );
procedure Print_Paths (
Head : in Headarray;
Map : in Maparray );
procedure Load_Paths (
Head : out Headarray;
Map : out Maparray );
procedure Save_Paths (
Head : in Headarray;
Map : in Maparray );
end Waypoints;