summaryrefslogtreecommitdiff
path: root/src/squares.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/squares.adb')
-rw-r--r--src/squares.adb58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/squares.adb b/src/squares.adb
new file mode 100644
index 0000000..673f425
--- /dev/null
+++ b/src/squares.adb
@@ -0,0 +1,58 @@
+
+
+package body Squares is
+
+
+ function Is_Walkable
+ (This : in Square)
+ return Boolean is
+ begin
+ return This.Walkable;
+ end Is_Walkable;
+
+
+
+
+ function Get_Contents
+ (This : in Square)
+ return Things.Thing is
+ begin
+ return This.Contents;
+ end Get_Contents;
+
+
+
+
+ procedure Set_Contents
+ (This : in out Square;
+ Item : in Things.Thing) is
+ begin
+ This.Contents := Item;
+ end Set_Contents;
+
+
+
+
+ procedure Draw
+ (This : in Square;
+ X, Y : in Integer) is
+ begin
+ This.Self_Image.Draw (X, Y);
+ This.Contents.Draw (X, Y);
+ end Draw;
+
+
+
+
+ function "="
+ (A, B : in Square)
+ return Boolean is
+ begin
+ return
+ A.Walkable = B.Walkable and
+ A.Self_Image = B.Self_Image;
+ end "=";
+
+
+end Squares;
+