void RunChecks(TChecks C) { TRuns Runs; TRuns RunsKill; Rand.Clear(); for (int n = 0; n < C.Count; n++) { RunsKill = C[n].GetRunsKill(Pole); if (RunsKill.Count > 0) { Rand.Add(n); } } if (Rand.Count > 0) { C[Rand.Get].Run(Pole, null); return; } Rand.Clear(); for (int n = 0; n < C.Count; n++) { Runs = C[n].GetRuns(Pole); if (Runs.Count > 0) { Rand.Add(n); } } if (Rand.Count > 0) { C[Rand.Get].Run(Pole, null); } else { IsGame = false; WB Cx; if (IsW) { Cx = WB.W; } else { Cx = WB.B; } Pole.GameOver(Cx); Pole = new TPole(gPole); } }
public TPole(Canvas g) { this.g = g; DrawCell(); CW = new TChecks(WB.W, g); CB = new TChecks(WB.B, g); DrawCheckers(); }