Beispiel #1
0
        public void Recall_PerformCommand_SetRecall()
        {
            Mock <IBaseObjectId> roomId    = new Mock <IBaseObjectId>();
            Mock <IRoom>         room      = new Mock <IRoom>();
            Mock <IParameter>    parameter = new Mock <IParameter>();
            IRecallBeacon        recall    = new RecallBeacon();

            tagWrapper.Setup(e => e.WrapInTag("Recall point set.", TagType.Info)).Returns("message");
            mockCommand.Setup(e => e.Parameters).Returns(new List <IParameter>()
            {
                parameter.Object
            });
            parameter.Setup(e => e.ParameterValue).Returns("set");
            room.Setup(e => e.Items).Returns(new List <IItem>()
            {
                recall
            });
            mob.Setup(e => e.Room).Returns(room.Object);

            IResult result = command.PerformCommand(mob.Object, mockCommand.Object);

            Assert.IsTrue(result.ResultSuccess);
            Assert.AreEqual("message", result.ResultMessage);
            mob.VerifySet(e => e.RecallPoint = It.IsAny <IBaseObjectId>());
        }
Beispiel #2
0
        public T CreateItem <T>()
        {
            Type  type = typeof(T);
            IItem item = null;

            if (type == typeof(IItem) ||
                type == typeof(Item))
            {
                item = new Item();
            }
            else if (type == typeof(Fountain))
            {
                item = new Fountain();
            }
            else if (type == typeof(IRecallBeacon) ||
                     type == typeof(RecallBeacon))
            {
                item = new RecallBeacon();
            }
            else if (type == typeof(IContainer) ||
                     type == typeof(Container))
            {
                item = new Container();
            }
            else if (type == typeof(IEnchantery) ||
                     type == typeof(Enchantery))
            {
                item = new Enchantery();
            }
            else if (type == typeof(IMoney) ||
                     type == typeof(Money))
            {
                item = new Money();
            }

            if (item == null)
            {
                throw new Exception($"Unsupported type {type.ToString()}");
            }
            else
            {
                item.Id   = ItemId++;
                item.Zone = Zone.Id;
            }

            return((T)item);
        }
Beispiel #3
0
        private IRoom GenerateRoom21()
        {
            IRoom room = GenearteRoom();

            room.MovementCost = 1;
            room.Attributes.Add(Room.RoomAttribute.Outdoor);
            room.Attributes.Add(Room.RoomAttribute.Weather);

            room.ExamineDescription = "The dome appears to 50 feet across and 30 to 40 feet across.  There are 8 pillars 5 feet in diameter made of marble holding up the dome.  Each pillar is made of either white marble or black marble in alternating fashion.  The light dancing through the dome cast interesting patterns on the white cobble stone.  Directly under the center of the dome is a large circular stone that could be used for sitting.  In the center of the stone is an inscription. \"Built 02/14/0024 by Charon\"";
            room.LongDescription    = "A giant stained glass dome stands 30 to 40 feet above you.  The light shining through the dome cast interesting patterns on the cobble stone floor causing you to admire its beauty for a moment.";
            room.ShortDescription   = "Under the stained glass dome";

            room.Items.Add(Room21_Sign());
            IRecallBeacon beacon = new RecallBeacon();

            beacon.Id = itemId++;
            room.Items.Add(beacon);
            return(room);
        }
Beispiel #4
0
        public void Setup()
        {
            GlobalReference.GlobalValues = new GlobalValues();

            beacon = new RecallBeacon();
        }
Beispiel #5
0
 public void Setup()
 {
     beacon = new RecallBeacon();
 }