Exemple #1
0
        public static LifeNPCType toPositive(this TargetSubClass flags)
        {
            bool ok = flags == TargetSubClass.AllTarget;

            if (ok)
            {
                return(LifeNPCType.SkTarAll);
            }

            //默认所有的都选择出来
            LifeNPCType type = LifeNPCType.SkTarAll;

            //不要建筑物
            ok = flags.check(TargetSubClass.Forbid_Building);
            if (ok)
            {
                type = type.clear(LifeNPCType.Build);
            }

            //不要小兵
            ok = flags.check(TargetSubClass.Forbid_Unit);
            if (ok)
            {
                type = type.clear(LifeNPCType.Soldier);
            }

            //不要英雄
            ok = flags.check(TargetSubClass.Forbid_Hero);
            if (ok)
            {
                type = type.clear(LifeNPCType.Hero);
            }

            //不要召唤物
            ok = flags.check(TargetSubClass.Forbid_Summon);
            if (ok)
            {
                type = type.clear(LifeNPCType.Summon);
            }

            return(type);
        }
Exemple #2
0
 public static TargetSubClass set(this TargetSubClass flags, TargetSubClass totest)
 {
     return(flags | totest);
 }
Exemple #3
0
 public static bool check(this TargetSubClass flags, TargetSubClass totest)
 {
     return((flags & totest) == totest);
 }