-
Notifications
You must be signed in to change notification settings - Fork 0
/
Smer.pas
65 lines (56 loc) · 919 Bytes
/
Smer.pas
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
unit Smer;
interface
type
TSmer = Class(TObject)
private
x,y : Integer;
public
constructor Create(x,y : Integer);
function getX : Integer;
function getY : Integer;
End;
TDolu = Class(TSmer)
constructor Create();
End;
TDoleva = Class(TSmer)
constructor Create();
End;
TDoprava = Class(TSmer)
constructor Create();
End;
TNic = Class(TSmer)
constructor Create();
End;
var
Dolu: TDolu;
implementation
constructor TSmer.Create(x: Integer; y: Integer);
begin
self.x := x;
self.y := y;
end;
function TSmer.getX;
begin
result := x;
end;
function TSmer.getY;
begin
result := y;
end;
constructor TDolu.Create;
begin
inherited Create(0,1);
end;
constructor TDoleva.Create;
begin
inherited Create(-1,0);
end;
constructor TDoprava.Create;
begin
inherited Create(1,0);
end;
constructor TNic.Create;
begin
inherited Create(0,0);
end;
end.