-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayer-graphics2d-double.adb
137 lines (115 loc) · 3.14 KB
/
player-graphics2d-double.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
with Ada.Text_Io;
package body Player.Graphics2d.Double is
procedure Log (S : String) renames Ada.Text_Io.Put_Line;
------------
-- Create --
------------
overriding procedure Create
(This : in out Object;
Conn : in Client.Connection_Type;
Index : in Natural := 0)
is
begin
Log ("AT CREATE");
for I in This.Canvases'Range loop
Log ("AT CREATE " & I'Img);
This.Canvases (I) := new Buffered.Object;
Log ("AT CREATE new");
This.Canvases (I).Create (Conn,
Index + Natural (I - Canvases_range'First));
Log ("AT CREATE create idx" &
Natural'Image (Index + Natural (I - Canvases_range'First)));
end loop;
Log ("After CREATE");
end Create;
---------------
-- Subscribe --
---------------
procedure Subscribe (This : in out Object; Mode : in Access_Modes) is
begin
for I in This.Canvases'Range loop
This.Canvases (I).Subscribe (Mode);
end loop;
end Subscribe;
overriding
procedure Unsubscribe (This : in out Object) is
begin
for I in This.Canvases'Range loop
This.Canvases (I).Unsubscribe;
end loop;
end Unsubscribe;
-----------
-- Clear --
-----------
overriding procedure Clear
(This : in out Object)
is
begin
for I in This.Canvases'Range loop
This.Canvases (I).Clear;
This.Canvases (I).Flush;
end loop;
end Clear;
---------------
-- Set_Color --
---------------
overriding procedure Set_Color
(This : in out Object;
Color : in Types.Player_Color_Type)
is
begin
This.Canvases (This.Active).Set_Color (Color);
end Set_Color;
-------------------
-- Draw_Polyline --
-------------------
overriding procedure Draw_Polyline
(This : in out Object;
Points : in Types.Point_2d_Array)
is
begin
This.Canvases (This.Active).Draw_Polyline (Points);
end Draw_Polyline;
-------------------
-- Draw_Polyline --
-------------------
overriding procedure Draw_Polyline
(This : in out Object;
Points : in Types.Point_2d_Vector)
is
begin
This.Canvases (This.Active).Draw_Polyline (Points);
end Draw_Polyline;
------------------
-- Fill_Polygon --
------------------
overriding procedure Fill_Polygon
(This : in out Object;
Points : in Types.Point_2d_Array)
is
begin
This.Canvases (This.Active).Fill_Polygon (Points);
end Fill_Polygon;
------------------
-- Fill_Polygon --
------------------
overriding procedure Fill_Polygon
(This : in out Object;
Points : in Types.Point_2d_Vector)
is
begin
This.Canvases (This.Active).Fill_Polygon (Points);
end Fill_Polygon;
-----------
-- Flush --
-----------
not overriding procedure Flush
(This : in out Object)
is
begin
This.Canvases (This.Active).Flush;
This.Canvases (This.Active - 1).Clear;
This.Canvases (This.Active - 1).Flush;
This.Active := This.Active + 1;
end Flush;
end Player.Graphics2d.Double;