Exemple #1
0
        public string MakeAStory(IStoryElements storyElements)
        {
            var numberOfMonsters = (storyElements.monster.NumberOfMonsters == 1) ? "a" : storyElements.monster.NumberOfMonsters.ToString();

            var story = $"You stand in a room {storyElements.room.Width}' x {storyElements.room.Length}'.\n"
                        + $"On the far side of the room you see {numberOfMonsters} {storyElements.monster.Name}, \n"
                        + $"guarding a {storyElements.loot.Description}";

            return(story);
        }
Exemple #2
0
        public DungeonGeneratorService(
            IPresentation presentationAdapter,
            IStoryMaker storyMaker,
            IStoryElements storyElements)
        {
            if (presentationAdapter == null)
            {
                throw new ArgumentNullException("PresentationAdapter cannot be null");
            }
            _presentationAdapter = presentationAdapter;

            if (storyMaker == null)
            {
                throw new ArgumentNullException("StoryMaker cannot be null");
            }
            _storyMaker = storyMaker;

            if (storyElements == null)
            {
                throw new ArgumentNullException("StoryElements cannot be null");
            }
            _storyElements = storyElements;
        }