Ejemplo n.º 1
0
 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());
     }
 }
Ejemplo n.º 2
0
        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());
                }
            }
        }