Exemplo n.º 1
0
        private int GetPrivateColor(RunicButton runicButton, Colors colors)
        {
            string fieldName = "old" + colors.ToString();

            FieldInfo fieldInfo = runicButton.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
            int       value     = (int)fieldInfo.GetValue(runicButton);

            return(value);
        }
Exemplo n.º 2
0
        public void Setup()
        {
            GlobalReference.GlobalValues = new GlobalValues();

            tagWrapper   = new Mock <ITagWrapper>();
            world        = new Mock <IWorld>();
            zone         = new Mock <IZone>();
            room4        = new Mock <IRoom>();
            room6        = new Mock <IRoom>();
            room22       = new Mock <IRoom>();
            performer    = new Mock <IMobileObject>();
            statue4      = new Mock <IRunicStatue>();
            statue6      = new Mock <IRunicStatue>();
            statue22     = new Mock <IRunicStatue>();
            itemStatue4  = statue4.As <IItem>();
            itemStatue6  = statue6.As <IItem>();
            itemStatue22 = statue22.As <IItem>();
            Dictionary <int, IZone> dictionaryZone = new Dictionary <int, IZone>();
            Dictionary <int, IRoom> dictionaryRoom = new Dictionary <int, IRoom>();
            List <IItem>            itemsForRoom4  = new List <IItem>()
            {
                itemStatue4.Object
            };
            List <IItem> itemsForRoom6 = new List <IItem>()
            {
                itemStatue6.Object
            };
            List <IItem> itemsForRoom22 = new List <IItem>()
            {
                itemStatue22.Object
            };

            tagWrapper.Setup(e => e.WrapInTag(It.IsAny <string>(), TagType.Info)).Returns((string x, TagType y) => (x));
            world.Setup(e => e.Zones).Returns(dictionaryZone);
            zone.Setup(e => e.Rooms).Returns(dictionaryRoom);
            performer.Setup(e => e.Room).Returns(room4.Object);
            room4.Setup(e => e.Items).Returns(itemsForRoom4);
            room6.Setup(e => e.Items).Returns(itemsForRoom6);
            room22.Setup(e => e.Items).Returns(itemsForRoom22);
            dictionaryZone.Add(0, zone.Object);
            dictionaryRoom.Add(4, room4.Object);
            dictionaryRoom.Add(6, room6.Object);
            dictionaryRoom.Add(22, room22.Object);

            GlobalReference.GlobalValues.TagWrapper = tagWrapper.Object;
            GlobalReference.GlobalValues.World      = world.Object;

            button = new RunicButton();
        }