public MyPoint(Cell cell, int side, int i, int j) { _image = null; if (!cell.Enabled) return; CurrentCell = cell; cell.Enabled = false; I = i; J = j; _image = new Image(); _image.Height = HEIGHT; _image.Width = WIDTH; _image.IsEnabled = false; SetNewLocation(cell.X, cell.Y); Side = side; }
private void Jump(MyPoint p, Cell c, int i, int j) { p.SetNewLocation(c.X, c.Y); p.I = i; p.J = j; c.Enabled = false; p.CurrentCell.Enabled = true; p.CurrentCell = c; IsLightTurn = !IsLightTurn; Expansion(p); // MessageBox.Show(String.Format("Game over! The winner is: {0}", _lightList.Count == 0 ? "Green team" : "Red team")); }
public void Clone(Cell c, int side, int i, int j) { MyPoint t = new MyPoint(c, side, i, j); this._grid.Children.Add(t.CurrentImage); if (t.Side == MyPoint.LIGHT) _lightList.Add(t); else _darkList.Add(t); IsLightTurn = !IsLightTurn; Expansion(t); // MessageBox.Show(String.Format("Game over! The winner is: {0}", _lightList.Count == 0 ? "Green team" : "Red team")); }