Example #1
0
        public void AskVoiceConcrete_creatureName_ReturnConcreteCreatureVoice()
        {
            room.Add(new Forest("forest"));
            room.AddCreature("Demiguise", "Vabjorn");
            string expectedVoice = "\"Urff Urff\"";
            string actualVoice   = room.AskVoiceConcrete("Vabjorn");

            Assert.AreEqual(expectedVoice, actualVoice);
        }
Example #2
0
        public override string AskVoiceConcrete(string creatureName)
        {
            Place  creatureRoom = null;
            string voice        = "";

            creatureRoom = InnerPlaces.Find(a => a.CreatureIsHere(creatureName) == true);

            if (creatureRoom == null)
            {
                foreach (Place composite in InnerPlaces.Where(a => a.IsComposite() == true))
                {
                    composite.AskVoiceConcrete(creatureName);
                }
            }
            else
            {
                voice = creatureRoom.AskVoiceConcrete(creatureName);
            }
            return(voice);
        }