public void addTurnOpponentEvent(string actualEventDescription, string playerName, int basePoint, int extraPoint, int numberOfDice, string diceType, int opponentPoint, bool isOpponentRollToo) { try { CalculatedTurnResult ctr = turnHandle.generateTurnOpponentEvent(actualEventDescription, playerName, basePoint, extraPoint, numberOfDice, diceType, opponentPoint, isOpponentRollToo); story.events.Add(ctr.generatedText); sendRolledDicesToPresenter(ctr.rolledDices); sendStoryToPresenter(); persistenceGateway.saveGame(story, gameName); } catch (NotSupportedDiceTypeException nsdte) { sendErrorCodeToPresenter(ErrorCode.NotSupportedDiceType, nsdte.Message.ToString()); } }
public void addTurnTaskEvent(string actualEventDescription, string playerName, int basePoint, int extraPoint, int numberOfDice, string diceType, string taskName) { TaskType taskType = findTaskTypeByName(taskName); if (taskType == null) { sendErrorCodeToPresenter(ErrorCode.InvalidTaskType); } else { try { CalculatedTurnResult ctr = turnHandle.generateTurnTaskEvent(actualEventDescription, playerName, basePoint, extraPoint, numberOfDice, diceType, taskType); story.events.Add(ctr.generatedText); sendRolledDicesToPresenter(ctr.rolledDices); sendStoryToPresenter(); persistenceGateway.saveGame(story, gameName); } catch (NotSupportedDiceTypeException nsdte) { sendErrorCodeToPresenter(ErrorCode.NotSupportedDiceType, nsdte.Message.ToString()); } } }