summaryrefslogtreecommitdiff
path: root/src/squares.adb
blob: 673f425d1e958c9dc33b84e21fb489edb8b237f7 (plain)
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


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;