ExistFlag LifeNpcType2ExistFlag(LifeNPCType type, BuildNPCType bldType) { ExistFlag flag = ExistFlag.None; switch (type) { case LifeNPCType.Hero: flag = ExistFlag.Hero; break; case LifeNPCType.Build: switch (bldType) { case BuildNPCType.Tower: flag = ExistFlag.Tower; break; case BuildNPCType.Barrank: case BuildNPCType.Base: flag = ExistFlag.Building; break; } break; case LifeNPCType.Soldier: flag = ExistFlag.minion; break; case LifeNPCType.Summon: flag = ExistFlag.Summoner; break; } return(flag); }
//按兵路得到建筑 public List <ServerLifeNpc> GetBuildByType(CAMP camp, BuildNPCType type) { List <ServerLifeNpc> list = new List <ServerLifeNpc>(); foreach (KeyValuePair <int, ServerNPC> itor in npcDic) { ServerLifeNpc lifenpc = itor.Value as ServerLifeNpc; if (lifenpc != null && lifenpc.WhatTypeOf == LifeNPCType.Build && lifenpc.IsAlive && lifenpc.data.configData.bldType == type) { if (camp == CAMP.None || camp == CAMP.All) { list.Add(lifenpc); } else if (lifenpc.Camp == camp) { list.Add(lifenpc); } } } return(list); }
public static BuildNPCType set(this BuildNPCType flags, BuildNPCType totest) { return(flags | totest); }
public static bool check(this BuildNPCType flags, BuildNPCType totest) { return((flags & totest) == totest); }