Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /Unit1.pas

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide annotations) (download) (as text)
Sat Jul 18 05:48:27 2015 UTC (8 years, 7 months ago) by yamat0jp
File MIME type: text/x-pascal
File size: 15081 byte(s)
Blenderで作った画像に手を加えました
1 yamat0jp 5 unit Unit1;
2 yamat0jp 1
3     interface
4    
5     uses
6 yamat0jp 5 System.SysUtils, System.Types, System.UITypes, System.Classes,
7     System.Variants,
8     FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Menus,
9     System.Math, FMX.Objects, FMX.StdCtrls;
10 yamat0jp 1
11     const
12     Count = 8;
13    
14     type
15 yamat0jp 14 TStoneType = (stNone, stWhite, stBlack, stError, stEffect);
16 yamat0jp 1
17 yamat0jp 14 TEffectData = record
18     X, Y: integer;
19     Left, Top: integer;
20     Stone: TStoneType;
21     end;
22    
23 yamat0jp 3 TGridData = array [0 .. Count - 1] of array [0 .. Count - 1] of TStoneType;
24 yamat0jp 1
25     TPlayer = class
26     private
27     FAuto: Boolean;
28 yamat0jp 4 FStone: TStoneType;
29 yamat0jp 1 public
30     property Auto: Boolean read FAuto write FAuto;
31 yamat0jp 4 property Stone: TStoneType read FStone write FStone;
32 yamat0jp 1 end;
33    
34     TStoneGrid = class
35     private
36     FStrings: TGridData;
37 yamat0jp 7 FBuffer: array [0 .. Count * Count - 4] of TGridData;
38 yamat0jp 1 FTurnNumber: integer;
39     FTurnIndex: integer;
40 yamat0jp 9 FActive: Boolean;
41 yamat0jp 14 List: TList;
42 yamat0jp 15 FBool: Boolean;
43 yamat0jp 14 FIndex_X: integer;
44     FIndex_Y: integer;
45 yamat0jp 1 function GetStrings(X, Y: integer): TStoneType;
46     procedure SetStrings(X, Y: integer; const Value: TStoneType);
47     procedure SetTurnNumber(const Value: integer);
48     public
49 yamat0jp 14 constructor Create;
50     destructor Destroy; override;
51 yamat0jp 1 procedure Clear;
52 yamat0jp 10 function CalScore(Stone: TStoneType; X, Y: integer): integer;
53     function CanSetStone(Stone: TStoneType; X, Y: integer; Reverse: Boolean;
54 yamat0jp 7 const Visible: Boolean = false): Boolean;
55 yamat0jp 10 function NextStone(Stone: TStoneType): TPoint;
56 yamat0jp 9 procedure Start;
57     procedure Restart;
58     procedure Pause;
59 yamat0jp 14 function ListExecute: Boolean;
60     procedure Paint(Canvas: TCanvas);
61     procedure ImageCount(X, Y: integer);
62 yamat0jp 3 property Strings[X, Y: integer]: TStoneType read GetStrings
63     write SetStrings; default;
64 yamat0jp 1 property TurnNumber: integer read FTurnNumber write SetTurnNumber;
65 yamat0jp 10 property Active: Boolean read FActive;
66 yamat0jp 1 end;
67    
68     TForm1 = class(TForm)
69     Timer1: TTimer;
70     MainMenu1: TMainMenu;
71 yamat0jp 5 MenuItem1: TMenuItem;
72     MenuItem2: TMenuItem;
73     MenuItem3: TMenuItem;
74     MenuItem4: TMenuItem;
75     MenuItem5: TMenuItem;
76     MenuItem6: TMenuItem;
77     MenuItem7: TMenuItem;
78     PaintBox1: TPaintBox;
79 yamat0jp 7 MenuItem8: TMenuItem;
80     MenuItem9: TMenuItem;
81     MenuItem10: TMenuItem;
82     MenuItem11: TMenuItem;
83     MenuItem12: TMenuItem;
84 yamat0jp 14 Timer2: TTimer;
85     Image1: TImage;
86     Image2: TImage;
87     Image3: TImage;
88     Image4: TImage;
89 yamat0jp 15 Image5: TImage;
90 yamat0jp 1 procedure FormCreate(Sender: TObject);
91     procedure FormDestroy(Sender: TObject);
92     procedure Timer1Timer(Sender: TObject);
93     procedure FormResize(Sender: TObject);
94 yamat0jp 5 procedure MenuItem4Click(Sender: TObject);
95     procedure MenuItem2Click(Sender: TObject);
96 yamat0jp 7 procedure PaintBox1Tap(Sender: TObject; const Point: TPointF);
97     procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
98 yamat0jp 5 Shift: TShiftState; X, Y: Single);
99     procedure PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
100     procedure MenuItem6Click(Sender: TObject);
101 yamat0jp 7 procedure PaintBox1Resize(Sender: TObject);
102     procedure MenuItem8Click(Sender: TObject);
103     procedure MenuItem10Click(Sender: TObject);
104     procedure MenuItem11Click(Sender: TObject);
105 yamat0jp 14 procedure Timer2Timer(Sender: TObject);
106 yamat0jp 1 private
107 yamat0jp 5 { Private ���� }
108 yamat0jp 1 StoneGrid: TStoneGrid;
109     Index: TPlayer;
110     Size: integer;
111     procedure CompStone;
112     procedure GameStart;
113     procedure ChangePlayer;
114     public
115 yamat0jp 5 { Public ���� }
116 yamat0jp 1 end;
117    
118     var
119     Player1: TPlayer;
120     Player2: TPlayer;
121    
122     Form1: TForm1;
123    
124     implementation
125    
126 yamat0jp 5 {$R *.fmx}
127 yamat0jp 7 {$R *.Windows.fmx MSWINDOWS}
128 yamat0jp 1 { TStoneGrid }
129    
130 yamat0jp 10 function TStoneGrid.CalScore(Stone: TStoneType; X, Y: integer): integer;
131 yamat0jp 1 var
132     i, j: integer;
133     begin
134 yamat0jp 10 if CanSetStone(Stone, X, Y, true) = true then
135 yamat0jp 1 begin
136 yamat0jp 10 if Stone = stBlack then
137     Stone := stWhite
138 yamat0jp 3 else
139 yamat0jp 10 Stone := stBlack;
140 yamat0jp 3 result := 0;
141     for i := 0 to Count - 1 do
142     for j := 0 to Count - 1 do
143 yamat0jp 10 if CanSetStone(Stone, i, j, false) = true then
144 yamat0jp 3 inc(result);
145 yamat0jp 9 FStrings := FBuffer[FTurnIndex];
146 yamat0jp 3 end
147     else
148 yamat0jp 1 begin
149 yamat0jp 9 FStrings := FBuffer[FTurnIndex];
150 yamat0jp 3 result := -1;
151 yamat0jp 1 end;
152     end;
153    
154 yamat0jp 10 function TStoneGrid.CanSetStone(Stone: TStoneType; X, Y: integer;
155 yamat0jp 7 Reverse: Boolean; const Visible: Boolean): Boolean;
156 yamat0jp 1 var
157 yamat0jp 14 i: integer;
158 yamat0jp 4 p: Boolean;
159 yamat0jp 14 q: ^TEffectData;
160 yamat0jp 4 procedure Method(m, n: integer);
161 yamat0jp 3 var
162 yamat0jp 4 s: TStoneType;
163 yamat0jp 15 j, k: integer;
164 yamat0jp 1 begin
165 yamat0jp 4 if p = false then
166     Exit;
167     i := 1;
168 yamat0jp 3 while true do
169 yamat0jp 4 begin
170     s := GetStrings(X + m * i, Y + n * i);
171     if (s = stNone) or (s = stError) then
172     break
173 yamat0jp 10 else if s = Stone then
174 yamat0jp 4 if i > 1 then
175     begin
176 yamat0jp 15 if (result = false) and (Reverse = true) then
177     SetStrings(X, Y, Stone);
178 yamat0jp 4 result := true;
179     if Reverse = true then
180 yamat0jp 1 begin
181 yamat0jp 4 for j := 1 to i - 1 do
182 yamat0jp 7 begin
183 yamat0jp 15 Form1.PaintBox1.Repaint;
184 yamat0jp 14 if Visible = true then
185     begin
186     New(q);
187     q^.Left := X + m * j;
188     q^.Top := Y + n * j;
189     q^.Stone := Stone;
190     q^.X := 0;
191     q^.Y := 0;
192     List.Add(q);
193     SetStrings(q^.Left, q^.Top, stEffect);
194 yamat0jp 15 for k := 1 to 10 do
195     begin
196     Sleep(10);
197     Application.ProcessMessages;
198     end;
199 yamat0jp 14 end
200     else
201     SetStrings(X + m * j, Y + n * j, Stone);
202 yamat0jp 7 end;
203 yamat0jp 4 break;
204 yamat0jp 3 end
205     else
206 yamat0jp 1 begin
207 yamat0jp 4 p := false;
208 yamat0jp 3 break;
209 yamat0jp 4 end;
210     end
211     else
212     break
213 yamat0jp 3 else
214 yamat0jp 4 inc(i);
215     end;
216 yamat0jp 3 end;
217    
218     begin
219 yamat0jp 15 if Visible = true then
220     begin
221     FBool := FActive;
222     FActive := false;
223     end;
224 yamat0jp 14 result := false;
225     p := true;
226     if GetStrings(X, Y) = stNone then
227 yamat0jp 9 begin
228 yamat0jp 14 Method(-1, -1);
229     Method(-1, 0);
230     Method(-1, 1);
231     Method(0, -1);
232     Method(0, 1);
233     Method(1, -1);
234     Method(1, 0);
235     Method(1, 1);
236 yamat0jp 9 end;
237 yamat0jp 1 end;
238    
239     procedure TStoneGrid.Clear;
240     var
241     i, j: integer;
242     begin
243 yamat0jp 3 for i := 0 to Count - 1 do
244     for j := 0 to Count - 1 do
245     Strings[i, j] := stNone;
246     Strings[3, 3] := stBlack;
247     Strings[4, 4] := stBlack;
248     Strings[4, 3] := stWhite;
249     Strings[3, 4] := stWhite;
250 yamat0jp 7 FTurnNumber := 0;
251     FTurnIndex := 0;
252 yamat0jp 10 FBuffer[0] := FStrings;
253 yamat0jp 1 end;
254    
255 yamat0jp 14 constructor TStoneGrid.Create;
256     begin
257     inherited;
258     List := TList.Create;
259     end;
260    
261     destructor TStoneGrid.Destroy;
262     var
263     i: integer;
264     begin
265     for i := 0 to List.Count - 1 do
266     Dispose(List[i]);
267     List.Free;
268     inherited;
269     end;
270    
271 yamat0jp 1 function TStoneGrid.GetStrings(X, Y: integer): TStoneType;
272     begin
273 yamat0jp 3 if (X >= 0) and (X < Count) and (Y >= 0) and (Y < Count) then
274 yamat0jp 4 result := FStrings[X, Y]
275 yamat0jp 3 else
276     result := stError;
277 yamat0jp 1 end;
278    
279 yamat0jp 14 procedure TStoneGrid.ImageCount(X, Y: integer);
280     begin
281     FIndex_X := X;
282     FIndex_Y := Y;
283     end;
284    
285     function TStoneGrid.ListExecute: Boolean;
286     var
287     p: ^TEffectData;
288     i: integer;
289     begin
290     if List.Count = 0 then
291     result := false
292     else
293     begin
294     for i := 0 to List.Count - 1 do
295     begin
296     p := List.List[i];
297     if p^.X < FIndex_X - 1 then
298     p^.X := p^.X + 1
299     else if p^.Y < FIndex_Y - 1 then
300     begin
301     p^.X := 0;
302     p^.Y := p^.Y + 1;
303     end
304     else
305     begin
306     SetStrings(p^.Left, p^.Top, p^.Stone);
307     Dispose(p);
308     List[i] := nil;
309     end;
310     end;
311     for i := List.Count - 1 downto 0 do
312     if List[i] = nil then
313     List.Delete(i);
314     if List.Count = 0 then
315     begin
316 yamat0jp 15 FActive := FBool;
317 yamat0jp 14 inc(FTurnIndex);
318     inc(FTurnNumber);
319     FBuffer[FTurnIndex] := FStrings;
320     end;
321     result := true;
322     end;
323     end;
324    
325 yamat0jp 10 function TStoneGrid.NextStone(Stone: TStoneType): TPoint;
326 yamat0jp 1 var
327     i, j, m, n: integer;
328     begin
329 yamat0jp 3 n := -1;
330     for i := 0 to Count - 1 do
331     for j := 0 to Count - 1 do
332 yamat0jp 1 begin
333 yamat0jp 10 m := CalScore(Stone, i, j);
334 yamat0jp 3 if (n = -1) or ((m > -1) and (n > m)) then
335 yamat0jp 1 begin
336 yamat0jp 3 n := m;
337     result := Point(i, j);
338 yamat0jp 1 end;
339     end;
340     if n = -1 then
341 yamat0jp 3 result := Point(-1, -1);
342 yamat0jp 1 end;
343    
344 yamat0jp 14 procedure TStoneGrid.Paint(Canvas: TCanvas);
345     var
346     i: integer;
347     k, m, n: integer;
348     s: TBitmap;
349     p: ^TEffectData;
350     begin
351     m := Form1.Image3.Bitmap.Width;
352     n := Form1.Image3.Bitmap.Height;
353 yamat0jp 15 k := Form1.Size;
354 yamat0jp 14 for i := 0 to List.Count - 1 do
355     begin
356     p := List[i];
357     if p^.Stone = stBlack then
358     s := Form1.Image1.Bitmap
359     else
360     s := Form1.Image2.Bitmap;
361     Canvas.DrawBitmap(s, RectF(p^.X * m, p^.Y * n, (p^.X + 1) * m,
362     (p^.Y + 1) * n), RectF(p^.Left * k, p^.Top * k, (p^.Left + 1) * k,
363     (p^.Top + 1) * k), 1);
364     end;
365     end;
366    
367 yamat0jp 9 procedure TStoneGrid.Pause;
368     begin
369 yamat0jp 15 FBool := false;
370 yamat0jp 10 FActive := false;
371 yamat0jp 9 end;
372    
373     procedure TStoneGrid.Restart;
374     begin
375 yamat0jp 10 FActive := true;
376     FTurnIndex := FTurnNumber;
377 yamat0jp 9 end;
378    
379 yamat0jp 1 procedure TStoneGrid.SetStrings(X, Y: integer; const Value: TStoneType);
380     begin
381 yamat0jp 3 if (X >= 0) and (X < Count) and (Y >= 0) and (Y < Count) then
382     FStrings[X, Y] := Value;
383 yamat0jp 1 end;
384    
385     procedure TStoneGrid.SetTurnNumber(const Value: integer);
386     begin
387     if Value > FTurnIndex then
388 yamat0jp 4 FTurnNumber := FTurnIndex
389 yamat0jp 12 else if Value < 0 then
390     FTurnNumber := 0
391 yamat0jp 3 else
392     FTurnNumber := Value;
393 yamat0jp 10 FActive := false;
394 yamat0jp 3 FStrings := FBuffer[FTurnNumber];
395 yamat0jp 1 end;
396    
397 yamat0jp 9 procedure TStoneGrid.Start;
398     begin
399     Clear;
400     FActive := true;
401     end;
402    
403 yamat0jp 1 { TForm1 }
404    
405     procedure TForm1.ChangePlayer;
406     var
407     i, j, m, n: integer;
408     s: string;
409     procedure Main;
410     begin
411     if Index = Player1 then
412 yamat0jp 4 Index := Player2
413 yamat0jp 3 else
414     Index := Player1;
415 yamat0jp 1 end;
416     function Execute: Boolean;
417     var
418     i, j: integer;
419     begin
420 yamat0jp 3 result := false;
421     for i := 0 to Count - 1 do
422     for j := 0 to Count - 1 do
423 yamat0jp 10 if StoneGrid.CanSetStone(Index.Stone, i, j, false) = true then
424 yamat0jp 1 begin
425 yamat0jp 3 result := true;
426 yamat0jp 12 Exit;
427 yamat0jp 1 end;
428     end;
429 yamat0jp 3
430 yamat0jp 1 begin
431 yamat0jp 3 Main;
432 yamat0jp 1 if Execute = false then
433     begin
434 yamat0jp 3 Main;
435 yamat0jp 1 if Execute = false then
436     begin
437 yamat0jp 9 StoneGrid.Pause;
438 yamat0jp 3 Timer1.Enabled := false;
439     m := 0;
440     n := 0;
441     for i := 0 to Count - 1 do
442     for j := 0 to Count - 1 do
443     case StoneGrid[i, j] of
444     stBlack:
445     inc(m);
446     stWhite:
447     inc(n);
448 yamat0jp 1 end;
449     if m > n then
450 yamat0jp 4 s := 'Player1 Win:' + #13#10
451 yamat0jp 3 else if m < n then
452 yamat0jp 4 s := 'Player2 Win:' + #13#10
453 yamat0jp 3 else
454     s := 'Draw:' + #13#10;
455 yamat0jp 7 Showmessage(s + '(Player1) ' + IntToStr(m) + #13#10 + '(Player2) ' +
456     IntToStr(n));
457 yamat0jp 1 end;
458     end;
459     end;
460    
461     procedure TForm1.CompStone;
462     var
463     s: TPoint;
464     begin
465 yamat0jp 10 s := StoneGrid.NextStone(Index.Stone);
466     StoneGrid.CanSetStone(Index.Stone, s.X, s.Y, true, true);
467 yamat0jp 5 PaintBox1.Repaint;
468 yamat0jp 7 ChangePlayer;
469 yamat0jp 1 end;
470    
471     procedure TForm1.GameStart;
472     begin
473 yamat0jp 9 StoneGrid.Start;
474 yamat0jp 5 PaintBox1.Repaint;
475 yamat0jp 3 Index := Player1;
476     Timer1.Enabled := true;
477 yamat0jp 1 end;
478    
479 yamat0jp 7 procedure TForm1.MenuItem10Click(Sender: TObject);
480     begin
481 yamat0jp 9 StoneGrid.Restart;
482 yamat0jp 7 Timer1.Enabled := true;
483     end;
484    
485     procedure TForm1.MenuItem11Click(Sender: TObject);
486     begin
487 yamat0jp 10 Timer1.Enabled := false;
488 yamat0jp 7 with StoneGrid do
489     if Sender = MenuItem11 then
490     TurnNumber := TurnNumber + 1
491     else
492     TurnNumber := TurnNumber - 1;
493 yamat0jp 14 PaintBox1.Repaint;
494 yamat0jp 12 ChangePlayer;
495 yamat0jp 7 end;
496    
497 yamat0jp 5 procedure TForm1.MenuItem2Click(Sender: TObject);
498 yamat0jp 1 begin
499 yamat0jp 3 GameStart;
500 yamat0jp 1 end;
501    
502 yamat0jp 5 procedure TForm1.MenuItem4Click(Sender: TObject);
503 yamat0jp 1 begin
504 yamat0jp 5 Close;
505 yamat0jp 1 end;
506    
507 yamat0jp 5 procedure TForm1.MenuItem6Click(Sender: TObject);
508     begin
509 yamat0jp 7 Player1.Auto := MenuItem6.IsChecked;
510     Player2.Auto := MenuItem7.IsChecked;
511 yamat0jp 10 MenuItem10Click(Sender);
512 yamat0jp 5 end;
513    
514 yamat0jp 7 procedure TForm1.MenuItem8Click(Sender: TObject);
515     begin
516 yamat0jp 9 StoneGrid.Pause;
517     Timer1.Enabled := false;
518 yamat0jp 7 end;
519    
520 yamat0jp 5 procedure TForm1.PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
521 yamat0jp 1 var
522     i, j: integer;
523     begin
524 yamat0jp 15 for i := 0 to Count-1 do
525 yamat0jp 1 begin
526 yamat0jp 15 for j := 0 to Count-1 do
527 yamat0jp 1 begin
528 yamat0jp 3 case StoneGrid.Strings[i, j] of
529     stWhite:
530 yamat0jp 14 Canvas.DrawBitmap(Image4.Bitmap, RectF(0, 0, Image4.Bitmap.Width,
531     Image4.Bitmap.Height), RectF(i * Size, j * Size, (i + 1) * Size,
532 yamat0jp 7 (j + 1) * Size), 1);
533 yamat0jp 3 stBlack:
534 yamat0jp 14 Canvas.DrawBitmap(Image3.Bitmap, RectF(0, 0, Image3.Bitmap.Width,
535     Image3.Bitmap.Height), RectF(i * Size, j * Size, (i + 1) * Size,
536     (j + 1) * Size), 1);
537 yamat0jp 15 stEffect:
538     continue;
539 yamat0jp 14 else
540 yamat0jp 15 Canvas.DrawBitmap(Image5.Bitmap, RectF(0, 0, Image5.Bitmap.Width,
541     Image5.Bitmap.Height), RectF(i * Size, j * Size, (i + 1) * Size,
542     (j + 1) * Size), 1);
543 yamat0jp 1 end;
544 yamat0jp 15 Canvas.DrawLine(PointF(0, j * Size), PointF(Count * Size, j * Size), 1);
545 yamat0jp 1 end;
546 yamat0jp 15 Canvas.DrawLine(PointF(i * Size, 0), PointF(i * Size, Size * Count), 1);
547 yamat0jp 1 end;
548 yamat0jp 16 Canvas.DrawLine(PointF(Count*Size,0),PointF(Count*Size,Count*Size),1);
549     Canvas.DrawLine(PointF(0,Count*Size),PointF(Count*Size,Count*Size),1);
550 yamat0jp 14 if StoneGrid.Active = false then
551     StoneGrid.Paint(Canvas);
552 yamat0jp 1 end;
553    
554 yamat0jp 7 procedure TForm1.PaintBox1Resize(Sender: TObject);
555     begin
556     Size := Min(ClientWidth, ClientHeight) div Count;
557     end;
558    
559 yamat0jp 5 procedure TForm1.FormCreate(Sender: TObject);
560 yamat0jp 1 begin
561 yamat0jp 5 StoneGrid := TStoneGrid.Create;
562 yamat0jp 14 StoneGrid.ImageCount(Form1.Image1.Bitmap.Width div Form1.Image3.Bitmap.Width,
563     Form1.Image1.Bitmap.Height div Form1.Image3.Bitmap.Height);
564 yamat0jp 5 Player1 := TPlayer.Create;
565     Player2 := TPlayer.Create;
566     Player1.Stone := stBlack;
567     Player2.Stone := stWhite;
568     Player2.Auto := true;
569     with PaintBox1.Canvas do
570 yamat0jp 1 begin
571 yamat0jp 5 StrokeDash := TStrokeDash.Solid;
572     Stroke.Color := TAlphaColors.Black;
573     StrokeThickness := 3;
574 yamat0jp 1 end;
575 yamat0jp 7 PaintBox1Resize(Sender);
576 yamat0jp 5 GameStart;
577 yamat0jp 1 end;
578    
579 yamat0jp 5 procedure TForm1.FormDestroy(Sender: TObject);
580     begin
581     StoneGrid.Free;
582     Player1.Free;
583     Player2.Free;
584     end;
585    
586 yamat0jp 7 procedure TForm1.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
587 yamat0jp 5 Shift: TShiftState; X, Y: Single);
588     begin
589 yamat0jp 7 PaintBox1Tap(Sender, PointF(X, Y));
590 yamat0jp 5 end;
591    
592 yamat0jp 1 procedure TForm1.Timer1Timer(Sender: TObject);
593     begin
594 yamat0jp 10 if (StoneGrid.Active = true) and (Index.Auto = true) then
595 yamat0jp 1 begin
596 yamat0jp 3 Timer1.Enabled := false;
597     CompStone;
598     Timer1.Enabled := true;
599 yamat0jp 1 end;
600     end;
601    
602 yamat0jp 14 procedure TForm1.Timer2Timer(Sender: TObject);
603     begin
604     if StoneGrid.ListExecute = true then
605     PaintBox1.Repaint;
606     end;
607    
608 yamat0jp 1 procedure TForm1.FormResize(Sender: TObject);
609     begin
610 yamat0jp 3 Size := Min(ClientWidth, ClientHeight) div Count;
611 yamat0jp 5 PaintTo(Canvas);
612 yamat0jp 1 end;
613    
614 yamat0jp 7 procedure TForm1.PaintBox1Tap(Sender: TObject; const Point: TPointF);
615 yamat0jp 1 begin
616 yamat0jp 11 if Index.Auto = false then
617     begin
618 yamat0jp 10 MenuItem10Click(Sender);
619     if StoneGrid.CanSetStone(Index.Stone, Floor(Point.X / Size),
620 yamat0jp 7 Floor(Point.Y / Size), true, true) = true then
621 yamat0jp 5 begin
622     PaintBox1.Repaint;
623 yamat0jp 7 ChangePlayer;
624 yamat0jp 5 end;
625     end;
626 yamat0jp 1 end;
627    
628     end.

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26