-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuMain.pas
166 lines (126 loc) · 3.03 KB
/
uMain.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
unit uMain;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
ELandSlideException = Exception;
TDirection = (edSky, edGround, edForward, edRight, edLeft, edBack);
TDifficulty = (diEasy, diMedium, diHard);
TWindDirection = (wdNorth, wdSouth, wdEast, wdWest);
TSex = (sxMale, sxFemale);
TLife = class(TObject)
private
function Real: Boolean;
function Fantasy: Boolean;
end;
TEyes = class(TObject)
private
function Open(ADirection: TDirection = edForward): TEyes;
function See: TEyes;
end;
TCharacter = class(TObject)
private
FEyes: TEyes;
public
property Eyes: TEyes read FEyes;
end;
TWealth = class(TObject)
end;
TWind = class(TObject)
private
FDirection: TWindDirection;
public
property Direction: TWindDirection read FDirection write FDirection;
end;
TPiano = class(TObject)
public
procedure Play;
end;
TForm1 = class(TForm)
private
FLife: TLife;
FCharacter: TCharacter;
FWealth: TWealth;
FSex: TSex;
FSympathy: TStringList;
FComeDifficulty: TDifficulty;
FGoDifficulty: TDifficulty;
FLow: Double;
FHigh: Double;
FWind: TWind;
FMatter: Boolean;
FPiano: TPiano;
procedure Play;
public
property Life: TLife read FLife;
property Character: TCharacter read FCharacter;
property Wealth: TWealth read FWealth write FWealth;
property Sex: TSex read FSex write FSex;
property Sympathy: TStringList read FSympathy;
property ComeDifficulty: TDifficulty read FComeDifficulty;
property GoDifficulty: TDifficulty read FGoDifficulty;
property High: Double read FHigh;
property Low: Double read FLow;
property Wind: TWind read FWind;
property Matter: Boolean read FMatter write FMatter;
property Piano: TPiano read FPiano;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Play;
begin
try
Assert(Life.Real);
Assert(Life.Fantasy);
except
on ex: ELandSlideException do begin
{$REGION Reality}
while True do begin
Character.Eyes.Open(TDirection.edSky).See;
Self.Wealth := nil;
Self.Sex := TSex.sxMale;
Self.Sympathy.Clear;
if ((Self.ComeDifficulty = TDifficulty.diEasy) and
(Self.GoDifficulty = TDifficulty.diEasy) and
(Self.High < 0.1) and
(Self.Low < 0.1)) then
begin
case Wind.Direction of
wdNorth: ;
wdSouth: ;
wdEast: ;
wdWest: ;
else begin
Self.Matter:= False;
Piano.Play;
Break;
end;
end;
end;
end;
{$ENDREGION}
end;
end;
end;
{ TLife }
function TLife.Fantasy: Boolean;
begin
end;
function TLife.Real: Boolean;
begin
end;
{ TEyes }
function TEyes.Open(ADirection: TDirection): TEyes;
begin
end;
function TEyes.See: TEyes;
begin
end;
{ TPiano }
procedure TPiano.Play;
begin
end;
end.