public static bool ChangePawnToDame(FieldState[,] boardArray) { for (var i = 0; i < 8; i++) if (boardArray[0, i] == FieldState.YellowPawn || boardArray[7, i] == FieldState.RedPawn) return true; return false; }
private void AddFields(List<CustomFieldObject> FieldList, int NumberOfFields, FieldState fieldState) { for (int i = 0; i < NumberOfFields; i++) { FieldList.Add(CreateField(fieldState)); } }
public Pawn(int x, int y, FieldState currentState, FieldState previousState) { X = x; Y = y; CurrentState = currentState; PreviousState = previousState; }
private FieldState[,] boardArrayToFieldState() { var result = new FieldState[8, 8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { switch (_boardArray[i, j]) { case 0: result[i, j] = FieldState.Empty; break; case 1: result[i, j] = FieldState.RedPawn; break; case 2: result[i, j] = FieldState.YellowPawn; break; case 3: result[i, j] = FieldState.BluePawn; break; case 4: result[i, j] = FieldState.GreenPawn; break; default: result[i, j] = FieldState.Empty; break; } } } return result; }
private static void MoveDames(int x, int y, FieldState fieldState, GameState gameState) { if (fieldState != gameState.CurrentDame) return; for (var i = 0; i < 8; i++) MovePawn(x, y, x + i, y + i, gameState); for (var i = 0; i < 8; i++) MovePawn(x, y, x + i, y - i, gameState); for (var i = 0; i < 8; i++) MovePawn(x, y, x - i, y - i, gameState); for (var i = 0; i < 8; i++) MovePawn(x, y, x - i, y + i, gameState); }
public static bool ChangedPawns(FieldState[,] boardArray, FieldState[,] previousBoardArray) { for (var i = 0; i < 8; i++) if ((previousBoardArray[7, i] == FieldState.RedPawn && boardArray[7, i] != FieldState.BluePawn) || (previousBoardArray[0, i] == FieldState.YellowPawn && boardArray[0, i] != FieldState.GreenPawn)) return false; return true; }
private static void CapturePawns(FieldState[,] boardState, int x, int y, GameState gameState) { if (boardState[x, y] != gameState.CurrentPawn) return; CapturePawn(boardState, x, y, 1, 1, gameState, gameState.CurrentPawn); CapturePawn(boardState, x, y, 1, -1, gameState, gameState.CurrentPawn); CapturePawn(boardState, x, y, -1, -1, gameState, gameState.CurrentPawn); CapturePawn(boardState, x, y, -1, 1, gameState, gameState.CurrentPawn); }
private static void CaptureDames(FieldState[,] boardState, int x, int y, GameState gameState) { if (boardState[x, y] != gameState.CurrentDame) return; for (var i = 0; i < 8; i++) CapturePawn(boardState, x, y, i, i, gameState, gameState.CurrentDame); for (var i = 0; i < 8; i++) CapturePawn(boardState, x, y, i, -i, gameState, gameState.CurrentDame); for (var i = 0; i < 8; i++) CapturePawn(boardState, x, y, -i, -i, gameState, gameState.CurrentDame); for (var i = 0; i < 8; i++) CapturePawn(boardState, x, y, -i, i, gameState, gameState.CurrentDame); }
public override Point OnMove(FieldState[,] board) { var tocka = Helpers.RandomPoint(Height, Width); while (!board[(int)tocka.Y, (int)tocka.X].HasFlag(FieldState.Unknown)) tocka = Helpers.RandomPoint(Height, Width); return tocka; }
public static void ShowNotEmptyBoardContent(FieldState[,] board) { for(var i=0; i<8; i++) for (var j = 0; j < 8; j++) { if (board[i, j] == FieldState.Empty) continue; Console.WriteLine("[{0}, {1}] = {2}", i, j, board[i,j]); } }
private static void MovePawns(int x, int y, FieldState fieldState, GameState gameState) { if (fieldState != gameState.CurrentPawn) return; var direction = 0; if (fieldState == FieldState.RedPawn) direction = 1; if (fieldState == FieldState.YellowPawn) direction = -1; MovePawn(x, y, x + direction, y + 1, gameState); MovePawn(x, y, x + direction, y - 1, gameState); }
public GameState(FieldState[,] boardArray) { BoardArray = boardArray; PossibleMoves = new List<FieldState[,]>(); PossibleCapture = new List<FieldState[,]>(); CurrentPlayer = 0; CurrentPawn = FieldState.RedPawn; CurrentDame = FieldState.BluePawn; }
public GameState() { BoardArray = new FieldState[8, 8]; PreviousBoardArray = new FieldState[8, 8]; PossibleMoves = new List<FieldState[,]>(); PossibleCapture = new List<FieldState[,]>(); CurrentPlayer = 0; CurrentPawn = FieldState.RedPawn; CurrentDame = FieldState.BluePawn; }
public Field(int mineFieldCoordsX, int minefieldCoordsY, Vector2 displayPos, ref Field[,] map) { this.pos = displayPos; this.mineFieldCoordsX = mineFieldCoordsX; this.mineFieldCoordsY = minefieldCoordsY; this.fsFieldState = FieldState.unrevealed; this.map = map; this.texture = manager.contentManager.fieldTexUnrevealed; this.font = manager.contentManager.fntMinesNerby; this.rect = new Rectangle((int)pos.X, (int)pos.Y, 16, 16); }
public Playground(int width, int height, int depth, FieldState initial = FieldState.Empty) { Width = width; Height = height; Depth = depth; Field = new FieldState[width, height, depth]; for (int x = 0; x < Width; x++) for (int y = 0; y < Height; y++) for (int z = 0; z < Depth; z++) Field[x, y, z] = initial; }
public static void SetPossibleCapture(FieldState[,] boardState, GameState gameState) { gameState.PossibleCapture.Clear(); for (var i = 0; i < 8; i++) for (var j = 0; j < 8; j++) { CapturePawns(boardState, i, j, gameState); CaptureDames(boardState, i, j, gameState); } }
public List<Pawn> GetDiff(FieldState[,] baseArray = null, FieldState[,] compareArray = null) { if (baseArray == null) baseArray = _gameState.BoardArray; if (compareArray == null) compareArray = _gameState.PreviousBoardArray; var result = new List<Pawn>(); for(var i=0; i<8; i++) for (var j = 0; j < 8; j++) if (baseArray[i, j] != compareArray[i, j]) result.Add(new Pawn(i, j, baseArray[i, j], compareArray[i, j])); return result; }
public void UpdateBoard(FieldState[,] boardArray) { _gameState.BoardArray = boardArray; CaptureHelper.SetPossibleCapture(_gameState.PreviousBoardArray, _gameState); MoveHelper.SetPossibleMoves(_gameState); Validete(); if (MoveHelper.ChangePawnToDame(_gameState.BoardArray)) return; if (_playerCapture) { CaptureHelper.SetPossibleCapture(_gameState.BoardArray, _gameState); if (_gameState.PossibleCapture.Any()) return; } if (!IsError) _gameState.UpdateCurrentPlayer(); Console.WriteLine("Current player: {0}", _gameState.CurrentPlayer + 1); }
public string UpdateAndValidBoard(FieldState[,] boardArray) { if (!BoardIsNew(boardArray)) return String.Empty; if (IsError && GetDiff(boardArray, _gameState.PreviousBoardArray).Count == 0) { IsError = false; _gameState.Restore(); return "Now is OK"; } if (!IsError) UpdateBoard(boardArray); return Message; }
private static void CapturePawn(FieldState[,] boardState, int currentX, int currentY, int moveX, int moveY, GameState gameState, FieldState currentPawnType) { var opponentPawnX = currentX + moveX; var opponentPawnY = currentY + moveY; var opponentPawn = gameState.CurrentPawn == FieldState.RedPawn ? FieldState.YellowPawn : FieldState.RedPawn; var opponentDame = gameState.CurrentDame == FieldState.BluePawn ? FieldState.GreenPawn : FieldState.BluePawn; var newX = currentX + (moveX > 0 ? moveX + 1 : moveX - 1); var newY = currentY + (moveY > 0 ? moveY + 1 : moveY - 1); if ((boardState[currentX, currentY] != currentPawnType) || (opponentPawnX < 0 || opponentPawnX > 7 || opponentPawnY < 0 || opponentPawnY > 7) || (newX < 0 || newX > 7 || newY < 0 || newY > 7) || !((boardState[opponentPawnX, opponentPawnY] == opponentPawn) || (boardState[opponentPawnX, opponentPawnY] == opponentDame)) || (boardState[newX, newY] != FieldState.Empty)) return; var tmpBoard = (FieldState[,])boardState.Clone(); tmpBoard[newX, newY] = tmpBoard[currentX, currentY]; tmpBoard[currentX, currentY] = FieldState.Empty; tmpBoard[opponentPawnX, opponentPawnY] = FieldState.Empty; gameState.PossibleCapture.Add(tmpBoard); }
public GameField(FieldState state) { this.State = state; }
private void Initialize(FieldState initialState) { _width = initialState.Width; _height = initialState.Height; _cellGroupManager = new CellGroupManager(initialState); }
/// <summary> /// public Constructor /// </summary> public GameBoard() { BoardDataDisplay = new FieldState[BoardConsts.BoardHeight * BoardConsts.BoardWidth]; BoardDataBuffer = new FieldState[(BoardConsts.BoardHeight + BoardConsts.BoardHeightOffset) * BoardConsts.BoardWidth]; currentBrick = new Brick(); }
public Player(FieldState mark, string ID) { this.ID = ID; this.Mark = mark; }
void ChangeAddressFieldEvent(string text, string example_text, FieldState state) { ServerEntry.Text = text; ServerEntry.Enabled = state == FieldState.Enabled; ServerEntry.ExampleText = example_text; }
public static void RefreshBoard(GoBoardControl boardControl, IObservableGameTreeNavigator <MCTreeSearchNode <GameState, FieldCoordinates>, GameState, FieldCoordinates> navigator) { GameState currentState = navigator.CurrentNode.State; var allowedActions = currentState.GetAllowedActions(); for (uint y = 0; y < boardControl.BoardSize; y++) { for (uint x = 0; x < boardControl.BoardSize; x++) { FieldCoordinates field = FieldCoordinates.Get(x, y); FieldState fieldState = currentState.InternalState.BoardFields[x, y]; boardControl.Fields[x, y].State = fieldState; boardControl.Fields[x, y].Labels.Clear(); // Illegal boardControl.Fields[x, y].Borders[0] = fieldState == FieldState.Empty ? allowedActions.Contains(field) == false : false; boardControl.Fields[x, y].Borders[1] = false; boardControl.Fields[x, y].Borders[2] = false; } } var currentNode = navigator.CurrentNode; //double[] mctsWeights = null;// mcts.Selector.GetWeights(mcts.CurrentNode); if (currentNode.Children != null) { foreach (var childNode in currentNode.Children) { if (childNode.Key != FieldCoordinates.Pass) { if (childNode.Value.Visits > 0) { boardControl.Fields[childNode.Key.X, childNode.Key.Y].AddLabel(Brushes.Magenta, $"{childNode.Value.Visits}"); boardControl.Fields[childNode.Key.X, childNode.Key.Y].AddLabel(Brushes.Green, $"{childNode.Value.Value}"); } } } var mostFrequentlySimulated = currentNode.Children.Where(w => w.Key != FieldCoordinates.Pass && w.Value.Visits > 0).MaxItems(i => i.Value.Visits); foreach (var mostItem in mostFrequentlySimulated) { boardControl.Fields[mostItem.Key.X, mostItem.Key.Y].Borders[2] = true; } } //if (mctsWeights != null) //{ // mctsWeights = mctsWeights.Where(w => w.Item1.LastAction != null && w.Item1.LastAction != FieldCoordinates.Pass); // // foreach (var item in mctsWeights) // { // var move = item.Item1.LastAction; // // if (move != null && move != FieldCoordinates.Pass) // { // boardControl.Fields[move.X, move.Y].AddLabel(Brushes.Blue, $"{item.Item2:f2}"); // } // } // // var maxItem = mctsWeights.MaxItem(i => i.Item2); // var maxMove = maxItem.Item1.LastAction; // // boardControl.Fields[maxMove.X, maxMove.Y].Borders[1] = true; //} boardControl.Refresh(); }
public Capture(FieldState[,] boardState) { BoardState = boardState; }
public bool SetState(Piece piece, FieldState state) { return(SetState(piece.Row, piece.Column, state)); }
private void AddFields(List <CustomFieldObject> FieldList, int NumberOfFields, FieldState fieldState) { for (int i = 0; i < NumberOfFields; i++) { FieldList.Add(CreateField(fieldState)); } }
public bool SetState(int r, int c, FieldState state) { board[r, c] = state; return(true); }
public static bool IsPiece(FieldState state) { return(state == FieldState.Red || state == FieldState.RedKing || state == FieldState.Black || state == FieldState.BlackKing); }
public static bool IsOfColor(Player player, FieldState state) { return((player == Player.Black && (state == FieldState.Black || state == FieldState.BlackKing)) || (player == Player.Red && (state == FieldState.Red || state == FieldState.RedKing))); }
public CellGroupManager(FieldState state) { _width = state.Width; _height = state.Height; _ourSign = state.PlayerSign; }
public static void RefreshBoard(GoBoardControl playoutBoardControl, GamePlayoutNode <GameState, FieldCoordinates> node) { if (node != null) { for (uint y = 0; y < playoutBoardControl.BoardSize; y++) { for (uint x = 0; x < playoutBoardControl.BoardSize; x++) { var field = playoutBoardControl.Fields[x, y]; FieldState fieldState = node.State.InternalState.BoardFields[x, y]; field.State = fieldState; field.Labels.Clear(); field.Label.Text = string.Empty; field.Borders[0] = false; field.Borders[1] = false; field.Borders[2] = false; } } foreach (var field in node.State.GetAllowedActionsForRandomPlayout()) { if (field != FieldCoordinates.Pass) { playoutBoardControl.Fields[field.X, field.Y].Borders[2] = true; } } var path = node.GetPath(); int num = 1; foreach (var item in path) { if (item.LastAction != null && item.LastAction != FieldCoordinates.Pass) { var field = playoutBoardControl.Fields[item.LastAction.X, item.LastAction.Y]; //field.State = item.GameState.CurrentPlayer.Opposite.Color.State; switch (item.Type) { case GamePlayoutNodeType.Selected: field.Borders[0] = true; break; case GamePlayoutNodeType.Expanded: field.Borders[1] = true; break; case GamePlayoutNodeType.Playout: if (field.Label.Text == string.Empty) { field.Label.Text = $"{num++}"; } else { field.Label.Text = $",{num++}"; } break; } } } //if (selectedRound.Value.Path != null) //{ // //} // //foreach (var item in selectedRound.Value.Selection.Where(p => p.LastAction != null && p.LastAction != FieldCoordinates.Empty)) //{ // var field = playoutBoardControl.Fields[item.LastAction.X, item.LastAction.Y]; // field.State = item.GameState.CurrentPlayer.Opposite.Color.State; // field.Borders[0] = true; //} // //if (selectedRound.Value.Expansion != null) //{ // var node = selectedRound.Value.Expansion; // var field = playoutBoardControl.Fields[node.LastAction.X, node.LastAction.Y]; // field.State = node.GameState.CurrentPlayer.Opposite.Color.State; // field.Borders[1] = true; //} // //int num = 1; // //foreach (var item in selectedRound.Value.Playout.Where(p => p.Item1 != null && p.Item1 != FieldCoordinates.Empty)) //{ // var field = playoutBoardControl.Fields[item.Item1.X, item.Item1.Y]; // field.State = item.Item2.CurrentPlayer.Opposite.Color.State; // field.AddLabel(Brushes.Gray, $"{num}"); // num++; //} playoutBoardControl.Refresh(); } }
public void SetupState(FieldState state) { piece.SetColor(state); Selectable = state == FieldState.SELECTABLE; }
int getFieldStateID(string stateInWords) { FieldState requistedFieldState = TipezeNyumbaServiceUnitOfWork.Repository <FieldState>().Get(u => u.state == stateInWords); return(requistedFieldState.fieldStateID); }
public void PlaceShip(Guid shipId) { State = FieldState.SHIP; ShipId = shipId; }
public Field(int?idOfTheShip, FieldState fieldState) { this.IdOfTheShip = idOfTheShip; this.State = fieldState; }
public BoardField(int x, int y) { X = x; Y = y; _fieldState = FieldState.Empty; }
public Field(FieldBuilder builder, PropertyBuilder property, FieldState state) { Builder = builder; Property = property; State = state; }
void ChangePathFieldEvent(string text, string example_text, FieldState state) { FolderEntry.Text = text; FolderEntry.Enabled = state == FieldState.Enabled; FolderEntry.ExampleText = example_text; }
public bool IsInsideAndHasState(uint x, uint y, FieldState stone) { return(Inside(x, y) && BoardFields[x, y] == stone); }
public abstract Cell GetNextMove(FieldState fieldState);
public override Cell GetNextMove(FieldState fieldState) { throw new NotImplementedException(); }
public static void AddMove(GlobalState state, FieldState fromField, List <(string, List <FieldState>)> moveList, string endPos)
public bool InitAndValid(FieldState[,] boardArray) { InitBoard(boardArray); return InitialValid(); }
public void SetState(FieldState state) { State = state; }
public void InitBoard(FieldState[,] boardArray) { _gameState = new GameState(boardArray); Console.WriteLine("Init new Board"); Console.WriteLine("Current player: {0}", _gameState.CurrentPlayer + 1); }
public void SetItemValue(DataField field, FieldState state) { var item = ModelItem; item.SetPropertyValue(field.BindingProperty, state.Value); }
private void RaiseBoardChangedEvent(FieldState[,] board) { if (BoardChanged != null) { BoardChanged(this, board); } }
private void GameOnGameCompleted(object sender, FieldState e) { App.RunOnUiThread(() => DrawState(e)); }
/* * A GameEnd függyvény megvizsgálja a beérkező x, y pozíciók alapján, hogy a lépést végrehajtó játékosnak összegyűlt-e a szükséges mennyiségű szomszédos lépése. * Igaz értéket ad vissza ha összegyűlt, tehát a játéknak vége. * Hamis értéket ad vissza ha még nem gyűlt össze. * Paraméterei: * x: Amely sorba a játékos megtette lépését. * y: Amely oszlopba a játékos megtette lépését. * step: Ahány szomszédos lépésnek össze kell gyűlnie a nyereséghez. */ static bool GameEnd(GridModel table, int x, int y, int step) { int testx = x, testy = y, borderx = 0, bordery = 0; int sum = 0; int[] testdirx = { 0, 0, 1, -1, -1, 1, 1, -1 }; int[] testdiry = { 1, -1, 0, 0, 1, -1, 1, -1 }; FieldState prev = table[x, y]; for (int i = 0; i < 8; i++) { switch (testdirx[i]) { case -1: borderx = -1; break; case 0: borderx = -2; break; case 1: borderx = table.Height; break; } switch (testdiry[i]) { case -1: bordery = -1; break; case 0: bordery = -2; break; case 1: bordery = table.Width; break; } while (!(testy == bordery || testx == borderx || table[testx, testy] != prev || sum == step)) { sum++; testx += testdirx[i]; testy += testdiry[i]; } if ((i + 1) % 2 == 0 && (sum - 1) >= step) { return(true); } else if ((i + 1) % 2 == 0 && (sum - 1) < step) { sum = 0; } testx = x; testy = y; } return(false); }
public void Shoot_WhenCalled_ShouldProperlyChangeFieldState(FieldState initialState, FieldState expectedState) { var field = new Field(initialState); var returnedState = field.Shoot(); field.State.Should().Be(expectedState); }
private bool BoardIsNew(FieldState[,] boardArray) { return (GetDiff(_gameState.BoardArray, boardArray).Count > 0); }
private void _validationWorker_DoWork(object sender, DoWorkEventArgs e) { while (!_validationWorker.CancellationPending) { #region Some Shit Image<Bgr, Byte> ImageFrameClone = CurrentCapture.Copy(new Rectangle(0, 0, 480, 480)); Tuple<FieldCounter[,], Image<Bgr, Byte>> result = getFileStateTabel(ImageFrameClone); ImageFrameClone = result.Item2; FieldState[,] fieldStareTable; fieldStareTable = new FieldState[8, 8]; bool playerMakeMove = false; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { int[] fieldValues = { result.Item1[i, j].white, result.Item1[i, j].black, result.Item1[i, j].red, result.Item1[i, j].green, result.Item1[i, j].blue, result.Item1[i, j].yellow, result.Item1[i, j].undefined }; int dominationColor = fieldValues.Max(); if (result.Item1[i, j].white == dominationColor) { fieldStareTable[i, j] = FieldState.Empty; } else if (result.Item1[i, j].black == dominationColor) { fieldStareTable[i, j] = FieldState.Empty; } else if (result.Item1[i, j].red == dominationColor) { fieldStareTable[i, j] = FieldState.RedPawn; } else if (result.Item1[i, j].green == dominationColor) { fieldStareTable[i, j] = FieldState.GreenPawn; } else if (result.Item1[i, j].yellow == dominationColor) { fieldStareTable[i, j] = FieldState.YellowPawn; } else if (result.Item1[i, j].blue == dominationColor) { fieldStareTable[i, j] = FieldState.BluePawn; } else if (result.Item1[i, j].undefined == dominationColor) { playerMakeMove = true; break; } } if (playerMakeMove) { break; } } if (!playerMakeMove) { RaiseBoardChangedEvent(fieldStareTable); } RaiseValidatedImageChangedEvent(ImageFrameClone.Bitmap); #endregion } }
public Field(FieldState state) { State = state; }
public Player(FieldState state) { Id = Guid.NewGuid(); State = state; }
/* * Az AI függvény a megkapott tábla alapján a referencia szerint érkező aix, aiy pozíciók értékét meghatározza, * így ad választ a játékosok lépéseire. * Paraméterei: * -CPU: az a FieldState változó ami az AIhoz tartozik. */ static void AI(GridModel table, FieldState CPU, ref int aix, ref int aiy) { List <int> lx = new List <int>(); List <int> ly = new List <int>(); int[] testdirx = { 0, -1, -1, -1, 0, 1, 1, 1 }; int[] testdiry = { -1, -1, 0, 1, 1, 1, 0, -1 }; Random rnd = new Random(); int choice; //Összegyűjti a már meglévő lépéseket a táblán. for (int i = 1; i < table.Height - 1; i++) { for (int j = 1; j < table.Width - 1; j++) { if (table[i, j] != FieldState.None) { for (int k = 0; k < 8; k++) { if (table[i + testdirx[k], j + testdiry[k]] == FieldState.None) { lx.Add(i + testdirx[k]); ly.Add(j + testdiry[k]); } } } } } for (int i = 1; i < table.Height - 1; i++) { if (table[i, 0] != FieldState.None && table[i, 1] == FieldState.None) { lx.Add(i); ly.Add(1); } if (table[i, table.Width - 1] != FieldState.None && table[i, table.Width - 2] == FieldState.None) { lx.Add(i); ly.Add(table.Width - 2); } } for (int i = 1; i < table.Width - 1; i++) { if (table[0, i] != FieldState.None && table[1, i] == FieldState.None) { lx.Add(0); ly.Add(i); } if (table[table.Height - 1, i] != FieldState.None && table[table.Height - 2, i] == FieldState.None) { lx.Add(table.Height - 2); ly.Add(i); } } if (table[0, 0] != FieldState.None) { for (int i = 4; i <= 6; i++) { if (table[0 + testdirx[i], 0 + testdiry[i]] == FieldState.None) { lx.Add(0 + testdirx[i]); ly.Add(0 + testdiry[i]); } } } if (table[0, table.Width - 1] != FieldState.None) { for (int i = 6; i <= 8; i++) { if (table[0 + testdirx[i % 8], table.Width - 1 + testdiry[i % 8]] == FieldState.None) { lx.Add(0 + testdirx[i % 8]); ly.Add(table.Width - 1 + testdiry[i % 8]); } } } if (table[table.Height - 1, 0] != FieldState.None) { for (int i = 2; i <= 4; i++) { if (table[table.Height - 1 + testdirx[i], 0 + testdiry[i]] == FieldState.None) { lx.Add(table.Height - 1 + testdirx[i]); ly.Add(0 + testdiry[i]); } } } if (table[table.Height - 1, table.Width - 1] != FieldState.None) { for (int i = 0; i <= 2; i++) { if (table[table.Height - 1 + testdirx[i], table.Width - 1 + testdiry[i]] == FieldState.None) { lx.Add(table.Height - 1 + testdirx[i]); ly.Add(table.Width - 1 + testdiry[i]); } } } //Ha nem üres a tábla, random választ egy elemet az összegyűjtött pozíciók listájából. //Ha üres akkor a tábla közepére helyezi lépését. if (lx.Count == 0) { aix = table.Height / 2; aiy = table.Width / 2; } else { choice = rnd.Next(0, lx.Count); aix = lx[choice]; aiy = ly[choice]; } }
private CustomFieldObject CreateField(FieldState fieldState) { return new CustomFieldObject() { FieldState = fieldState }; }
public bool IsOutsideOrHasState(uint x, uint y, FieldState stone) { return(Inside(x, y) == false || BoardFields[x, y] == stone); }