lace_gel_0.1.0_2c333035/source/dolly/gel-dolly.adb

 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
with
     ada.unchecked_Deallocation;

package body gel.Dolly
is
   use Math;


   procedure free (Self : in out View)
   is
      procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View);
   begin
      if Self = null
      then
         return;
      end if;

      Self.destroy;
      deallocate (Self);
   end free;


   --------------
   --- Attributes
   --

   procedure add_Camera (Self : in out Item'Class;   the_Camera : in Camera.view)
   is
   begin
      Self.Cameras.append (the_Camera);
   end add_Camera;



   procedure is_moving (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True)
   is
   begin
      Self.Motion (Direction) := Now;
   end is_moving;



   procedure is_spinning (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True)
   is
   begin
      Self.Spin (Direction) := Now;
   end is_spinning;



   procedure is_orbiting (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True)
   is
   begin
      Self.Orbit (Direction) := Now;
   end is_orbiting;



   procedure Speed_is (Self : in out Item;  Now : in Real)
   is
   begin
      Self.Speed := Now;
   end Speed_is;



   function Speed (Self : in Item) return Real
   is
   begin
      return Self.Speed;
   end Speed;



   procedure speed_Multiplier_is (Self : in out Item;  Now : in Real)
   is
   begin
      Self.Multiplier := Now;
   end speed_Multiplier_is;


end gel.Dolly;