private void m_MachineTurnTimer_Tick(object sender, EventArgs e) { this.m_MachineTurnTimer.Stop(); this.m_MachineTurnCounter++; this.m_PlayerPointer = this.m_GameLogicComponent.CurrentPlayerPointer; if (this.m_MachineTurnCounter == 1) { this.m_PlayerPointer.FirstStep = this.m_GameLogicComponent.GetRandomMachineStep(); IndexPictureBox machineSelectedButton = this.m_IndexPictureBoxesMatrix[this.m_PlayerPointer.FirstStep.RowIndex, this.m_PlayerPointer.FirstStep.ColumnIndex]; this.m_GameLogicComponent.SwitchCardStatus(this.m_PlayerPointer.FirstStep); //להוציא החוצה? showClickedButtonText(machineSelectedButton); this.m_MachineTurnTimer.Start(); } else { this.m_MachineTurnCounter = 0; this.m_PlayerPointer.SecondStep = this.m_GameLogicComponent.GetMachineSecondStep(this.m_PlayerPointer.FirstStep); IndexPictureBox machineSelectedButton = this.m_IndexPictureBoxesMatrix[this.m_PlayerPointer.SecondStep.RowIndex, this.m_PlayerPointer.SecondStep.ColumnIndex]; this.m_GameLogicComponent.SwitchCardStatus(this.m_PlayerPointer.SecondStep); //להוציא החוצה? showClickedButtonText(machineSelectedButton); this.m_CardsRevealTimer.Start(); } }
private PlayerStep performHumanStep(IndexPictureBox i_IndexButtonSender) { PlayerStep playerStepToReturn = new PlayerStep(i_IndexButtonSender.HeightIndex, i_IndexButtonSender.WidthIndex); this.m_GameLogicComponent.SwitchCardStatus(playerStepToReturn); return(playerStepToReturn); }
private void preformATurn(IndexPictureBox i_IndexButton) { if (this.m_GameLogicComponent.CheckIfCardIsNotShown(i_IndexButton.HeightIndex, i_IndexButton.WidthIndex)) { this.m_PlayerStepsCounter++; this.m_PlayerPointer = this.m_GameLogicComponent.CurrentPlayerPointer; showClickedButtonText(i_IndexButton); if (this.m_PlayerStepsCounter == 1) { this.m_PlayerPointer.FirstStep = performHumanStep(i_IndexButton); } else { this.m_PlayerPointer.SecondStep = performHumanStep(i_IndexButton); this.m_CardsRevealTimer.Start(); } } }
private void showClickedButtonText(IndexPictureBox i_IndexPictureBox) { i_IndexPictureBox.SetIndexPictureBoxImage(); i_IndexPictureBox.BackColor = this.m_GameLogicComponent.CurrentPlayerPointer.PlayerColor; }