/*------------------WINNINER-RELATED-----------------------*/ private void DisplayWinner() { Console.Clear(); DrawGFX.SetDrawPosition(50, 8); Console.WriteLine("CONGRATULATIONS!!!!"); DrawGFX.SetDrawPosition(50, 8); Console.WriteLine("Winner is: " + winner + "!"); }
/*=========================================================== * MOVEMENT * ===========================================================*/ /*------------------GAMEPLAYER & PIECE - RELATED------------------*/ //Move the piece on the board private void MovePiece(int playerIndex, int pieceIndex, GamePiece pieceToMove, int diceValue) { int previousGlobalPosition = GetGlobalPosition(playerIndex, pieceIndex); int previousLocalPiecePosition = GetPreviousPieceLocalPosition(playerIndex, pieceIndex); int newLocalPiecePosition = GetNewLocalPiecePosition(playerIndex, pieceIndex, diceValue); int newGlobalPosition = GetGlobalPosition(playerIndex, pieceIndex); newGlobalPosition = CheckCollision(playerIndex, pieceIndex, previousGlobalPosition, newGlobalPosition); MoveLocalPiece(playerIndex, pieceIndex, previousLocalPiecePosition, newLocalPiecePosition); MoveGlobalPiece(playerIndex, pieceIndex, previousGlobalPosition, newGlobalPosition); //print positions to screen DrawGFX.SetDrawPosition(0, ConsolePosition.SubInfoPos); Console.WriteLine($"Player {GamePlayers[playerIndex].GamePlayerID}, Piece {pieceToMove.PieceID} moved from position {previousGlobalPosition} to position {newGlobalPosition} in Game Board" + $" and to position {newLocalPiecePosition} in Player Board"); }
public IGameSession SetSessionData() { Console.Clear(); string[] tmpOptions = Enum.GetNames(typeof(GameColors)); List <string> colorOptions = new List <string>(tmpOptions); Console.WriteLine("Please type in your names"); for (int i = 1; i <= PlayerAmount; i++) { DrawGFX.SetDrawPosition(0, 1); Console.Write($"Name player {i}: "); PlayerName = Console.ReadLine(); while (string.IsNullOrEmpty(PlayerName)) { Console.Clear(); Console.WriteLine("Sorry. You have to fill in a name"); Console.Write($"Name player {i}: "); PlayerName = Console.ReadLine(); } DrawGFX.SetDrawPosition(0, 3); Console.WriteLine("Choose your player color:"); int colorID = CreateInteractable.OptionMenu(true, colorOptions, 0, 5); string choosenColor = colorOptions[colorID]; SessionPlayerData.Add(Tuple.Create(i, PlayerName, choosenColor)); colorOptions.RemoveAt(colorID); DrawGFX.ClearDrawContent(0, 3); DrawGFX.ClearDrawContent(0, 1); } return(this); }
/// <summary> /// Create a menu, optional parameters. string text display a text above menu. /// posX1 and posY1 sets position of menu, posX2 and posY2 sets position of string text /// </summary> /// <param name="horizontal"></param> /// <param name="options"></param> /// <param name="posX1"></param> /// <param name="posY1"></param> /// <returns></returns> public static int OptionMenu(bool horizontal, string[] options, int posX1 = 0, int posY1 = 0) { int selectedIndex = 0; Console.CursorVisible = false; ConsoleKey?key = null; while (key != ConsoleKey.Enter) { DrawGFX.SetDrawPosition(posX1, posY1); if (horizontal == false) { for (int i = 0; i < options.Length; i++) { if (i == selectedIndex) { Console.BackgroundColor = ConsoleColor.DarkBlue; Console.ForegroundColor = ConsoleColor.White; } Console.WriteLine(options[i]); Console.ResetColor(); } key = Console.ReadKey().Key; if (key == ConsoleKey.DownArrow) { selectedIndex++; if (selectedIndex == options.Length) { selectedIndex = 0; } } else if (key == ConsoleKey.UpArrow) { selectedIndex--; if (selectedIndex == -1) { selectedIndex = options.Length - 1; } } } else { for (int i = 0; i < options.Length; i++) { if (i == selectedIndex) { Console.BackgroundColor = ConsoleColor.DarkBlue; Console.ForegroundColor = ConsoleColor.White; } Console.Write(" " + options[i] + " "); Console.ResetColor(); } key = Console.ReadKey().Key; if (key == ConsoleKey.RightArrow) { selectedIndex++; if (selectedIndex == options.Length) { selectedIndex = 0; } } else if (key == ConsoleKey.LeftArrow) { selectedIndex--; if (selectedIndex == -1) { selectedIndex = options.Length - 1; } } } if (horizontal == false) { DrawGFX.ClearDrawContent(0, posY1, posY1 + options.Length); } else { DrawGFX.ClearDrawContent(posX1, posY1); } DrawGFX.SetDrawPosition(posX1, posY1); } return(selectedIndex); }
/*------------------Collission-RELATED-----------------------*/ private int CheckCollision(int playerIndex, int pieceIndex, int newLocalPosition, int newGlobalPosition) { DrawGFX.ClearDrawContent(0, 5, 8); int globalMaxPosition = CoordinateOuterPosition.Count - 1; if (newGlobalPosition >= globalMaxPosition) { newGlobalPosition = (newGlobalPosition - globalMaxPosition); } if (CoordinateOuterPosition[newGlobalPosition].IsOccupied == true) { var currentPlayerID = GamePlayers[playerIndex].GamePlayerID; var currentPlayerColor = GamePlayers[playerIndex].Color; var currentPlayerName = GamePlayers[playerIndex].Name; var currentPlayerPieceID = GamePlayers[playerIndex].Pieces[pieceIndex].PieceID; var otherPlayerID = CoordinateOuterPosition[newGlobalPosition].OccupiedPlayerID; var otherPlayerName = GamePlayers.Where(n => n.GamePlayerID == otherPlayerID).Select(n => n.Name).FirstOrDefault(); var otherPlayerColor = GamePlayers.Where(n => n.GamePlayerID == otherPlayerID).Select(n => n.Color).FirstOrDefault(); var otherPlayerPieceID = CoordinateOuterPosition[newGlobalPosition].OccupiedPlayerPieceID; var otherPlayerObject = GamePlayers.Where(n => n.GamePlayerID == otherPlayerID).FirstOrDefault(); int otherPlayerIndex = GetPlayerIndex(otherPlayerObject); var otherPlayerPiece = GetPieceByID(otherPlayerIndex, otherPlayerPieceID); int otherPlayerPieceIndex = GetPieceIndex(otherPlayerIndex, otherPlayerPiece); //måste ha metod som hanterar om piece tex gul piece är 0 if (currentPlayerID != otherPlayerID) { //print knockout-data to console DrawGFX.ClearDrawContent(0, 5, 8); DrawGFX.SetDrawPosition(50, 5); Console.WriteLine("==KNOCK OUT!=="); DrawGFX.SetDrawPosition(50, 6); Console.WriteLine($"{currentPlayerColor} Player {currentPlayerID}: {currentPlayerName}, {currentPlayerPieceID} knocked out:"); //DrawGFX.SetDrawPosition(50, 7); //Console.WriteLine($"{otherPlayerColor} Player {otherPlayerID}, (gameplayer index {otherPlayerIndex}): {otherPlayerName}, piece {otherPlayerPieceID}, (piece index {otherPlayerIndex})"); //clear occupational boardindex CoordinateOuterPosition[newGlobalPosition].IsOccupied = false; CoordinateOuterPosition[newGlobalPosition].OccupiedPlayerID = 0; CoordinateOuterPosition[newGlobalPosition].OccupiedPlayerPieceID = 0; //clear other player picepositions int otherPlayerPieceLocalPos = GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentPos; GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].LocalCoordinatePositions[otherPlayerPieceLocalPos] = false; GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentPos = 0; GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentGlobalPos = 0; GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].LocalCoordinatePositions[otherPlayerPieceLocalPos] = true; otherPlayerPieceLocalPos = GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentGlobalPos; //print other player pice position after knockout DrawGFX.SetDrawPosition(50, 8); Console.WriteLine($"{otherPlayerColor} Player {otherPlayerID}: {otherPlayerName}, piece {otherPlayerPieceID} moved to position {otherPlayerPieceLocalPos}"); } else if (currentPlayerID == otherPlayerID) { if (newGlobalPosition != GamePlayers[otherPlayerIndex].GlobalStartPos) { //print move behind-data to console DrawGFX.ClearDrawContent(0, 5, 8); DrawGFX.SetDrawPosition(50, 5); Console.WriteLine("==MOVE BEHIND=="); DrawGFX.SetDrawPosition(50, 6); Console.WriteLine($"{currentPlayerColor} Player {currentPlayerID}: {currentPlayerName}, {currentPlayerPieceID} same position as self:"); DrawGFX.SetDrawPosition(50, 7); Console.WriteLine($"{otherPlayerColor} Player {otherPlayerID}, (gameplayer index {otherPlayerIndex}): {otherPlayerName}, piece {otherPlayerPieceID}, (piece index {otherPlayerIndex})"); newGlobalPosition -= 1; int otherPlayerPieceLocalPos = GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentPos; int currentplayerLocalPos = GamePlayers[playerIndex].Pieces[pieceIndex].CurrentPos; GamePlayers[playerIndex].Pieces[pieceIndex].LocalCoordinatePositions[otherPlayerPieceLocalPos] = false; GamePlayers[playerIndex].Pieces[pieceIndex].CurrentPos--; GamePlayers[playerIndex].Pieces[pieceIndex].CurrentGlobalPos--; int currentLocalPos = GamePlayers[playerIndex].Pieces[pieceIndex].CurrentPos--; GamePlayers[playerIndex].Pieces[pieceIndex].LocalCoordinatePositions[currentLocalPos] = true; int otherPlayerPieceGlobalPos = GamePlayers[otherPlayerIndex].Pieces[otherPlayerPieceIndex].CurrentGlobalPos--; DrawGFX.SetDrawPosition(50, 8); Console.WriteLine($"{otherPlayerColor} Player {otherPlayerID}: {otherPlayerName}, piece {otherPlayerPieceID} moved 1 step behind to global position {otherPlayerPieceGlobalPos} and local position {currentplayerLocalPos}"); } } } return(newGlobalPosition); }
//this loop runs the game public void GameLoop() { Console.OutputEncoding = Encoding.UTF8; if (NewGame == true) { Console.Clear(); Console.OutputEncoding = Encoding.UTF8; InitializeGame(); //decide which player start IDictionary <int, int> playersRoll = new Dictionary <int, int>(); for (int i = 1; i <= GamePlayerAmnt; i++) { DrawGFX.SetDrawPosition(0, ConsolePosition.InfoPos); Console.WriteLine("[GAME PROGRESS INFORMATION]"); DrawGFX.SetDrawPosition(0, ConsolePosition.SubInfoPos); Console.WriteLine("Decide which player starts by rolling the dice. Highest number wins"); DrawGFX.SetDrawPosition(0, ConsolePosition.StatusPos); Console.WriteLine($"Player {i} please roll the dice. Press[ENTER] to roll"); DrawGFX.SetDrawPosition(0, ConsolePosition.InteractablePos); int diceValue = CreateInteractable.SingleButton(dice.Roll, "Roll"); DrawGFX.SetDrawPosition(0, ConsolePosition.ResultPos); Console.WriteLine($"Player {i} rolls: {diceValue}"); playersRoll.Add(i, diceValue); } int playerIDStart = DecidePlayerStart(playersRoll); DrawGFX.SetDrawPosition(0, ConsolePosition.StatusPos); Console.WriteLine($"Player {playerIDStart} got the highest number and therefore start. Press[ENTER] to continue "); GamePlayers = SetPlayOrder(playerIDStart, GamePlayers); Console.ReadKey(); Console.Clear(); } else { InitializeBoardCoordinates(); for (int i = 0; i < GamePlayerAmnt; i++) { GamePlayers[i].GlobalStartPos = SetColorStartPositon(GamePlayers[i].Color); } } //continue gameloop until winner while (winner == "") { //all the gameplay here for (int i = 0; i < GamePlayerAmnt; i++) { playerTextColor = DrawGFX.BrushColor(GamePlayers[i].Color); /******************************************** * GFX-POSITIONING STATUSTEXT ********************************************/ //header DrawGFX.SetDrawPosition(0, ConsolePosition.InfoPos); Console.Write(new string("[GAME PROGRESS INFORMATION]").PadRight(35)); //position for dialogue DrawGFX.ClearDrawContent(0, ConsolePosition.StatusPos); DrawGFX.SetDrawPosition(0, ConsolePosition.StatusPos); Console.ForegroundColor = playerTextColor; Console.Write($"Player {GamePlayers[i].GamePlayerID}: {GamePlayers[i].Name}"); Console.ResetColor(); Console.WriteLine(" please roll the dice: "); //position for consoledivider DrawGFX.SetDrawPosition(0, ConsolePosition.DividerPos); Console.Write("\r\n" + new string('=', Console.WindowWidth) + "\r\n"); /******************************************** * GFX-POSITIONING GAME BOARD ********************************************/ //positon for Game Board Title DrawGFX.SetDrawPosition(0, ConsolePosition.GameBoardTitlePos); Console.WriteLine("GAME BOARD"); //position for Game Board Pieces DrawGFX.SetDrawPosition(0, ConsolePosition.GameBoardPiecePos); var commonGameBoardPieces = DrawGFX.CreateBoard(40, BoardGFXItem.GameBoardPiecesGFX); //get gameboardpieces position from CoordinateOuterPosition List <Tuple <int, int, string> > tmp = new List <Tuple <int, int, string> >(); for (int y = 0; y < CoordinateOuterPosition.Count; y++) { if (CoordinateOuterPosition[y].IsOccupied == true) { var color = GamePlayers.Where(c => c.GamePlayerID == CoordinateOuterPosition[y].OccupiedPlayerID).Select(c => c.Color).FirstOrDefault(); tmp.Add(Tuple.Create(y, CoordinateOuterPosition[y].OccupiedPlayerID, color)); } } commonGameBoardPieces = DrawGFX.RenderGameBoardPieces(commonGameBoardPieces, tmp); //position for Game Board DrawGFX.SetDrawPosition(0, ConsolePosition.GameBoardPos); var commonGameBoard = DrawGFX.CreateBoard(40, BoardGFXItem.GameBoardGFX); commonGameBoard = DrawGFX.RenderGameBoard(commonGameBoard); /******************************************** * GFX-POSITIONING PLAYER-RELATED ********************************************/ //player pieces var piece1 = GamePlayers[i].Pieces.Where(s => s.PieceID == 1).FirstOrDefault(); var piece2 = GamePlayers[i].Pieces.Where(s => s.PieceID == 2).FirstOrDefault(); var piece3 = GamePlayers[i].Pieces.Where(s => s.PieceID == 3).FirstOrDefault(); var piece4 = GamePlayers[i].Pieces.Where(s => s.PieceID == 4).FirstOrDefault(); //position for playerboard title DrawGFX.SetDrawPosition(0, ConsolePosition.PlayerBoardTitlePos); Console.ForegroundColor = playerTextColor; Console.WriteLine("PLAYER BOARD"); //position for playerboard info DrawGFX.SetDrawPosition(0, ConsolePosition.PlayerInfoPos); Console.Write(new string($"Player {GamePlayers[i].GamePlayerID}: {GamePlayers[i].Name}").PadRight(30)); Console.Write(new string("▲ = Player piece").PadRight(25)); Console.WriteLine("(▲) = Piece in Nest"); Console.ResetColor(); //position piece board 1 DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard1Pos); var playerBoard1 = DrawGFX.CreateBoard(46, BoardGFXItem.PieceBoardGFX); Console.Write(new string("[Piece 1]: ").PadRight(10)); //update piece gfx and render pieceboard § playerBoard1[piece1.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece1.CurrentPos); playerBoard1 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard1); //position piece board 2 DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard2Pos); var playerBoard2 = DrawGFX.CreateBoard(46, BoardGFXItem.PieceBoardGFX); Console.Write(new string("[Piece 2]: ").PadRight(10)); //update piece gfx and render pieceboard 2 playerBoard2[piece2.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece2.CurrentPos); playerBoard2 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard2); //position piece board 3 DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard3Pos); var playerBoard3 = DrawGFX.CreateBoard(46, BoardGFXItem.PieceBoardGFX); Console.Write(new string("[Piece 3]: ").PadRight(10)); //update piece gfx and render pieceboard 3 playerBoard3[piece3.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece3.CurrentPos); playerBoard3 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard3); //position piece board 4 DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard4Pos); var playerBoard4 = DrawGFX.CreateBoard(46, BoardGFXItem.PieceBoardGFX); Console.Write(new string("[Piece 4]: ").PadRight(10)); //update piece gfx and render pieceboard 4 playerBoard4[piece4.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece4.CurrentPos); playerBoard4 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard4); /******************************************** * DICE-RELATED ********************************************/ //position for dice btn DrawGFX.SetDrawPosition(0, ConsolePosition.InteractablePos); int diceValue = CreateInteractable.SingleButton(dice.Roll, "Roll"); //position for dice roll text DrawGFX.SetDrawPosition(0, ConsolePosition.ResultPos); Console.WriteLine("Dice rolled: " + diceValue); //dice-roll IList <string> options = new List <string>(); int selectedPiece = 0; //move a playerpiece based on dice value, method containing other methods MovePieceOnDiceResult(i, options, selectedPiece, diceValue); /******************************************** * RE-RENDER GFX ********************************************/ ////update piece gfx new position after movement playerBoard1[piece1.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece1.CurrentPos); playerBoard2[piece2.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece2.CurrentPos); playerBoard3[piece3.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece3.CurrentPos); playerBoard4[piece4.CurrentPos] = DrawGFX.UpdatePlayerPieceGFXByPosition(piece4.CurrentPos); //re-render piece boards DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard1Pos); Console.Write(new string("[Piece 1]: ").PadRight(10)); playerBoard1 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard1); DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard2Pos); Console.Write(new string("[Piece 2]: ").PadRight(10)); playerBoard2 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard2); DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard3Pos); Console.Write(new string("[Piece 3]: ").PadRight(10)); playerBoard3 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard3); DrawGFX.SetDrawPosition(0, ConsolePosition.PieceBoard4Pos); Console.Write(new string("[Piece 4]: ").PadRight(10)); playerBoard4 = DrawGFX.RenderPieceBoard(GamePlayers[i].Color, playerBoard4); //input to player to press enter DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine("Please press [ENTER] to continue"); Console.ReadKey(); /******************************************** * GFX-CLEANUP ********************************************/ //cleaning up console before next player DrawGFX.ClearDrawContent(0, ConsolePosition.SubInfoPos); DrawGFX.ClearDrawContent(0, ConsolePosition.InteractableInfoPos); DrawGFX.ClearDrawContent(0, ConsolePosition.ResultPos); //Winner var allPiecesFinished = GamePlayers[i].Pieces.All(p => p.PieceInGoal == true && p.CurrentPos == p.GoalPosIndex); if (allPiecesFinished == true) { winner = GamePlayers[i].Name; } } //Save Game or skip string[] saveOptions = { "Skip", "Save Game?" }; saveOrSkip = CreateInteractable.OptionMenu(true, saveOptions, 40, ConsolePosition.InfoPos); if (saveOrSkip == 1) { Console.Clear(); DrawGFX.SetDrawPosition(0, 0); Console.WriteLine("Saving data, please wait..."); DrawGFX.SetDrawPosition(0, 2); SaveGame(); Console.Clear(); } } SaveWinner(); DisplayWinner(); }
/*=========================================================== * DICE-LOGIC * ===========================================================*/ private void MovePieceOnDiceResult(int playerIndex, IList <string> options, int selectedPiece, int diceValue) { switch (diceValue) { case 1: DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine("Choose a piece to move"); options = CreatePieceBtnOptions(true, playerIndex); if (options.Count() != 0) { selectedPiece = (CreateInteractable.OptionMenu(true, options, 0, ConsolePosition.InteractablePos)); string pieceName = options[selectedPiece]; int pieceID = int.Parse(pieceName.Last().ToString()); var pieceToMove = GetPieceByID(playerIndex, pieceID); int pieceIndex = GetPieceIndex(playerIndex, pieceToMove); MovePiece(playerIndex, pieceIndex, pieceToMove, diceValue); } break; case 6: DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine("You rolled 6. Please make a choice:"); List <string> moveOptions = new List <string>(); var piecesInNest = GamePlayers[playerIndex].Pieces.Where(p => p.CurrentPos == p.LocalStartPos); if (piecesInNest.Count() >= 2) { moveOptions.Add("Move 1 piece 6 steps?"); moveOptions.Add("Move 2 pieces 1 step?"); } else { moveOptions.Add("Move 1 piece 6 steps?"); } int selectMoveOption = CreateInteractable.OptionMenu(true, moveOptions, 0, ConsolePosition.InteractablePos); DrawGFX.ClearDrawContent(0, ConsolePosition.InteractableInfoPos); if (selectMoveOption == 0) { DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine("Choose a piece to move"); options = CreatePieceBtnOptions(true, playerIndex); if (options.Count() != 0) { selectedPiece = (CreateInteractable.OptionMenu(true, options, 0, ConsolePosition.InteractablePos)); string pieceName = options[selectedPiece]; int pieceID = int.Parse(pieceName.Last().ToString()); var pieceToMove = GetPieceByID(playerIndex, pieceID); int pieceIndex = GetPieceIndex(playerIndex, pieceToMove); MovePiece(playerIndex, pieceIndex, pieceToMove, 6); } } else { for (int y = 1; y <= 2; y++) { DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine($"Choose piece {playerIndex} to move"); IList <string> pieceOptions = CreatePieceButtonOptionsInNest(playerIndex); if (pieceOptions.Count() != 0) { selectedPiece = (CreateInteractable.OptionMenu(true, pieceOptions, 0, ConsolePosition.InteractablePos)); string pieceName = pieceOptions[selectedPiece]; int pieceID = int.Parse(pieceName.Last().ToString()); var pieceToMove = GetPieceByID(playerIndex, pieceID); int pieceIndex = GetPieceIndex(playerIndex, pieceToMove); MovePiece(playerIndex, pieceIndex, pieceToMove, 1); } } } break; default: DrawGFX.SetDrawPosition(0, ConsolePosition.InteractableInfoPos); Console.WriteLine("Choose a piece to move"); options = CreatePieceBtnOptions(false, playerIndex); if (options.Count() != 0) { selectedPiece = (CreateInteractable.OptionMenu(true, options, 0, ConsolePosition.InteractablePos)); string pieceName = options[selectedPiece]; int pieceID = int.Parse(pieceName.Last().ToString()); var pieceToMove = GetPieceByID(playerIndex, pieceID); int pieceIndex = GetPieceIndex(playerIndex, pieceToMove); MovePiece(playerIndex, pieceIndex, pieceToMove, diceValue); } break; } }