private void PlayDirection(Point start, Size dir) { GameState.player Opponent = getOpponent(); for (start = start + dir; Board[start.X, start.Y] == Opponent; start = start + dir) { Board[start.X, start.Y] = Current_player; } }
private bool checkDirection(Point start, Size dir) { bool foundOpponent = false; GameState.player Opponent = getOpponent(); start = start + dir; while (boundsCheck(start) && Board[start.X, start.Y] == Opponent) { start = start + dir; foundOpponent = true; } return(foundOpponent && boundsCheck(start) && Board[start.X, start.Y] == Current_player); }