예제 #1
0
        public void ToggleBitTest()
        {
            var xbit = new ExtendedBitvector();

            xbit.SetBit(2);
            xbit.SetBit(8);

            Assert.That(xbit.IsSet(2), Is.True);
            xbit.ToggleBit(8);

            Assert.That(xbit.IsSet(8), Is.True);
        }
예제 #2
0
        public void RemoveBitTest()
        {
            var xbit = new ExtendedBitvector();

            xbit.SetBit(8);
            xbit.RemoveBit(8);

            Assert.That(xbit.IsSet(8), Is.False);
        }
        public static ExtendedBitvector GetAttacks(this MobileTemplate template)
        {
            var bv    = new ExtendedBitvector();
            var words = template.Attacks.Split(' ');

            foreach (var word in words)
            {
                bv.SetBit((int)EnumerationExtensions.GetEnumIgnoreCase <AttackTypes>(word));
            }
            return(bv);
        }
        public static ExtendedBitvector GetAffected(this MobileTemplate template)
        {
            var bv    = new ExtendedBitvector();
            var words = template.GetStatistic <string>(StatisticTypes.AffectedByFlags).Split(' ');

            foreach (var word in words)
            {
                bv.SetBit((int)EnumerationExtensions.GetEnumIgnoreCase <AffectedByTypes>(word));
            }
            return(bv);
        }
        public static ExtendedBitvector GetDefenses(this MobileTemplate template)
        {
            var flags = new ExtendedBitvector();
            var words = template.Defenses.Split(' ');

            foreach (var word in words)
            {
                flags.SetBit((int)EnumerationExtensions.GetEnumIgnoreCase <DefenseTypes>(word));
            }

            return(flags);
        }