//Létrehozza és megjeleníti a KNaVOptions egy példányát, ezt az ablakot pedig elrejti. private void KNaVButton_Click(object sender, EventArgs e) { KNaVOptions window = new KNaVOptions(this); this.Hide(); window.Show(); }
private int currentRollResult; //A játék játszása során használt változó, amiben minden dobása után a felhasználó (1. játékos) által dobott eredményt tároljuk. //Megadja az értéket az originForm-nak, figuresA-nak, figuresB-nek, boardLength-nek, bonusStepts-nek, és a playerStarts-nak. //A megadott paraméterek alapján inicializálja a currentGame KiNevetAVegen játékot. //Végül magát a form-ot inicializálja és kitölti az infoTextBox-ot. public KNaVMain(KNaVOptions origin, int boardLength, int bonusSteps, int figuresA, int figuresB, ref int[] diceArray, bool playerStarts, int inputEnemyTactic) { originForm = origin; this.figuresA = figuresA; this.figuresB = figuresB; this.boardLength = boardLength; this.bonusSteps = bonusSteps; this.playerStarts = playerStarts; currentGame = new KiNevetAVegen(boardLength, bonusSteps, figuresA, figuresB, ref diceArray, playerStarts, inputEnemyTactic); InitializeComponent(); outputTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); //board infoTextBox.AppendText("Game Board:"); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("-> |"); for (int i = 1; i <= boardLength; i++) { infoTextBox.AppendText(" " + i + " |"); } infoTextBox.AppendText(" ->"); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); //other info infoTextBox.AppendText("Player 1 figures: " + figuresA); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 2 figures: " + figuresB); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); if (playerStarts) { infoTextBox.AppendText("Player 1 Starts"); } else { infoTextBox.AppendText("Player 2 Starts"); } infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 2 follows Tactic " + inputEnemyTactic); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 1 Start Base (S1) is connected to Square 1"); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 2 Start Base (S2) is connected to Square " + ((boardLength / 2) + 1).ToString()); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 1 End Base (E1) is connected to Square " + boardLength.ToString()); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Player 2 End Base (E2) is connected to Square " + (boardLength / 2).ToString()); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Each End Base has " + (bonusSteps - 1).ToString() + " bonus squares leading up to it (B1_1, B1_2, ...)"); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText(Environment.NewLine); infoTextBox.AppendText("Note: When describing game states or deciding which figures to step with, the figures are always ordered. (closest to end - farthest to end)"); infoTextBox.AppendText(Environment.NewLine); }