summaryrefslogtreecommitdiff
path: root/src/moves.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/moves.ads')
-rw-r--r--src/moves.ads62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/moves.ads b/src/moves.ads
new file mode 100644
index 0000000..ebf2bb1
--- /dev/null
+++ b/src/moves.ads
@@ -0,0 +1,62 @@
+
+
+private with
+
+ Ada.Containers.Vectors;
+
+
+package Moves is
+
+
+ type Move is record
+ Delta_X, Delta_Y : Integer;
+ Push : Boolean;
+ end record;
+
+
+ Null_Move : constant Move;
+
+
+
+
+ type Path is tagged private;
+
+
+ Empty_Path : constant Path;
+
+
+ procedure Add
+ (This : in out Path;
+ Item : in Move);
+
+
+ procedure Add
+ (This : in out Path;
+ List : in Path);
+
+
+ function Latest
+ (This : in Path)
+ return Move;
+
+
+ procedure Drop_Latest
+ (This : in out Path);
+
+
+private
+
+
+ package Move_Vectors is new Ada.Containers.Vectors
+ (Index_Type => Positive, Element_Type => Move);
+
+
+ type Path is new Move_Vectors.Vector with null record;
+
+
+ Null_Move : constant Move := (Delta_X => 0, Delta_Y => 0, Push => False);
+ Empty_Path : constant Path := (Move_Vectors.Empty_Vector with null record);
+
+
+end Moves;
+