| 353 |
inc(FTurnIndex); |
inc(FTurnIndex); |
| 354 |
inc(FTurnNumber); |
inc(FTurnNumber); |
| 355 |
FBuffer[FTurnIndex] := FStrings; |
FBuffer[FTurnIndex] := FStrings; |
| 356 |
|
if FGameOver = false then |
| 357 |
|
begin |
| 358 |
|
FActive:=true; |
| 359 |
|
Form1.ChangePlayer; |
| 360 |
|
end; |
| 361 |
end; |
end; |
| 362 |
result := true; |
result := true; |
| 363 |
end; |
end; |
| 411 |
|
|
| 412 |
procedure TStoneGrid.Restart; |
procedure TStoneGrid.Restart; |
| 413 |
begin |
begin |
| 414 |
FActive := true; |
FActive:=true; |
| 415 |
FGameOver := false; |
FGameOver := false; |
| 416 |
FTurnIndex := FTurnNumber; |
FTurnIndex := FTurnNumber; |
| 417 |
end; |
end; |
| 418 |
|
|
| 419 |
procedure TStoneGrid.SetActive(const Value: Boolean); |
procedure TStoneGrid.SetActive(const Value: Boolean); |
| 420 |
begin |
begin |
| 421 |
if FGameOver = false then |
if (FGameOver = false)or(Value = false) then |
| 422 |
FActive := Value; |
FActive := Value; |
| 423 |
end; |
end; |
| 424 |
|
|
| 441 |
|
|
| 442 |
procedure TStoneGrid.Start; |
procedure TStoneGrid.Start; |
| 443 |
begin |
begin |
|
FActive := true; |
|
| 444 |
Clear; |
Clear; |
| 445 |
|
FActive := true; |
| 446 |
FGameOver := false; |
FGameOver := false; |
| 447 |
end; |
end; |
| 448 |
|
|
| 486 |
Main; |
Main; |
| 487 |
if Execute = false then |
if Execute = false then |
| 488 |
begin |
begin |
|
StoneGrid.Pause; |
|
| 489 |
m := 0; |
m := 0; |
| 490 |
n := 0; |
n := 0; |
| 491 |
for i := 0 to Count - 1 do |
for i := 0 to Count - 1 do |
| 522 |
StoneGrid.NextStone(Index.Stone, s); |
StoneGrid.NextStone(Index.Stone, s); |
| 523 |
StoneGrid.CanSetStone(Index.Stone, s.X, s.Y, true, true); |
StoneGrid.CanSetStone(Index.Stone, s.X, s.Y, true, true); |
| 524 |
PaintBox1.Repaint; |
PaintBox1.Repaint; |
|
ChangePlayer; |
|
|
StoneGrid.Active := true; |
|
| 525 |
end; |
end; |
| 526 |
|
|
| 527 |
procedure TForm1.GameStart; |
procedure TForm1.GameStart; |
| 682 |
StoneGrid.Active := false; |
StoneGrid.Active := false; |
| 683 |
if StoneGrid.CanSetStone(Index.Stone, Floor(Point.X / Size), |
if StoneGrid.CanSetStone(Index.Stone, Floor(Point.X / Size), |
| 684 |
Floor(Point.Y / Size), true, true) = true then |
Floor(Point.Y / Size), true, true) = true then |
|
begin |
|
| 685 |
PaintBox1.Repaint; |
PaintBox1.Repaint; |
|
ChangePlayer; |
|
|
end; |
|
| 686 |
StoneGrid.Active := true; |
StoneGrid.Active := true; |
| 687 |
end; |
end; |
| 688 |
end; |
end; |