private void OnGameResult(eMoveResult i_Result) { if (GameResult != null) { GameResult.Invoke(i_Result); } }
private void Engine_GameResult(eMoveResult i_Result) { StringBuilder Text = new StringBuilder(); string caption; if (i_Result == eMoveResult.OLoose) { Text = Text.AppendFormat("The winner is: {0}!", r_PlayerOneNmae); caption = "A WIN!"; } else if (i_Result == eMoveResult.XLoose) { Text = Text.AppendFormat("The winner is: {0}!", r_PlayerTwoName); caption = "A WIN!"; } else { Text = Text.AppendFormat("Tie!", r_PlayerOneNmae); caption = "A Tie!"; } Text.AppendFormat(@" Would you like to play another game?"); DialogResult result = MessageBox.Show(Text.ToString(), caption, MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { m_Engine.startAnotherGame(); this.initializeAnotherGame(); this.updateTextLabels(); } else { this.DialogResult = DialogResult.Abort; } }
public MoveResult(eMoveResult emoveresult, string resultmessage) { this.MoveResultStatus = emoveresult; this.ResultMessage = resultmessage; }