public void BekeritGameOverTest() { _model._size = 6; _model.NewGame(); Assert.IsFalse(_model.CheckGameOver()); for (Int32 i = 0; i < 6; i++) { for (Int32 j = 0; j < 6; j++) { _model.Table.SetValue(i, j, 1); } } Assert.IsTrue(_model.CheckGameOver()); }
private void StepGame(Int32 index) { BekeritField field = Fields[index]; // field.Player = Model.Players.NoPlayer; if (_model.Player == Model.Players.PlayerBlue && field.IsLocked == false && field.PlayerColor == Model.Players.NoPlayer) { if (_model.GameSteps == 1) { field.Player = Model.Players.PlayerBlue; field.PlayerColor = Model.Players.PlayerBlue; field.IsLocked = true; _model.Step(field.X, field.Y); NotGray(); RefreshTable(); EnableSave = true; } else { field.PlayerColor = Model.Players.PlayerBlue; field.Player = Model.Players.PlayerBlue; field.IsLocked = true; _model.Step(field.X, field.Y); CheckAvailablePlaces(field.X, field.Y, index); EnableSave = false; } } else if (_model.Player == Model.Players.PlayerRed && field.IsLocked == false && field.PlayerColor == Model.Players.NoPlayer) { if (_model.GameSteps == 1) { field.Player = Model.Players.PlayerRed; field.PlayerColor = Model.Players.PlayerRed; field.IsLocked = true; _model.Step(field.X, field.Y); NotGray(); RefreshTable(); EnableSave = true; } else { field.Player = Model.Players.PlayerRed; field.PlayerColor = Model.Players.PlayerRed; field.IsLocked = true; _model.Step(field.X, field.Y); CheckAvailablePlaces(field.X, field.Y, index); EnableSave = false; } } _model.CheckGameOver(); }