From 2950872300a419344b39b9174f4b371a240272c6 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 30 Jul 2017 22:23:20 +1000 Subject: Basic game framework done, lacking any user input --- src/squares.adb | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/squares.adb (limited to 'src/squares.adb') 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; + -- cgit