public bool IsSameCamp(EntityCampType camp) { int campIndex = (int)camp % 2; int campIndex2 = (int)EntityCamp % 2; if (campIndex == campIndex2) { return(true); } return(false); }
public string GetGUIDName(UInt64 icon, EntityCampType camp) { foreach (BattleInfo battle in AllBlueTeam) { if (icon == battle.PlayerIcon) { return(battle.PlayerName); } } return(null); }
public static Ientity GetHomeBase(EntityCampType type) { foreach (var item in homeBaseList) { if (item.IsSameCamp(type)) { return(item); } } return(null); }
public Dictionary <UInt64, HeroBattleInfo> GetCamp(EntityCampType type) { if (type == EntityCampType.CampTypeA) { return(AllBlueHeroBattle); } else if (type == EntityCampType.CampTypeB) { return(AllRedHeroBattle); } return(null); }
public void Init(UInt64 objGUID, int headID, string nickName, int level, int kills, int death, int asstimes, int totalcp, int lasthit, EntityCampType camp) { mObjGUID = objGUID; mHeadID = headID; mNickName = nickName; mLevel = level; mKills = kills; mDeath = death; mAsstimes = asstimes; mTotalcp = totalcp; mLasthit = lasthit; mCamp = camp; }
public Iselfplayer(UInt64 sGUID, EntityCampType campType) : base(sGUID, campType) { UserGameItems = new Dictionary <int, int>(); UserGameItemsCount = new Dictionary <int, int>(); UserGameItemsCoolDown = new Dictionary <int, float>(); for (int ct = 0; ct < 6; ct++) { UserGameItems.Add(ct, 0); UserGameItemsCount.Add(ct, 0); UserGameItemsCoolDown.Add(ct, 0f); } }
/// <summary> /// 更新地图元素 /// </summary> /// <param name="entity"></param> private void UpdateMapElement(UInt64 guid, EntityCampType type, float x, float y, float z) { int index = (int)type; //获取实体阵营类型 if (index <= (int)EntityCampType.CampTypeKind) //全敌对,全和平类型元素不更新 { return; } UIMiniMapElement element = GetMapElement(guid);//获得Ientity所对应的地图元素 从mMapElementDic获取 if (element != null) { element.UpdatePosDirect(x, y, z);// 将对象直接设置到目标点 } }
/// <summary> /// 更新地图元素 /// </summary> /// <param name="entity"></param> private void UpdateMapElement(UInt64 guid, EntityCampType type, float x, float y, float z) { int index = (int)type; if (index <= (int)EntityCampType.CampTypeKind) { return; } UIMiniMapElement element = GetMapElement(guid); if (element != null) { element.UpdatePosDirect(x, y, z); } }
public override Ientity HandleCreateEntity(UInt64 sGUID, EntityCampType campType) //entity id { Iplayer player; if (GameUserModel.Instance.IsLocalPlayer(sGUID)) { player = new Iselfplayer(sGUID, campType); } else { player = new Iplayer(sGUID, campType); } player.GameUserId = sGUID; return(player); }
/// <summary> /// 获取阵营类型 /// </summary> /// <param name="campId"></param> /// <returns></returns> public static EntityCampType GetEntityCamp(int campId) { EntityCampType type = (EntityCampType)campId; if (campId > 0) { if (campId % 2 == 0) { type = EntityCampType.CampTypeB; } else { type = EntityCampType.CampTypeA; } } return(type); }
public static Dictionary <UInt64, HeroBattleInfo> AllBlueHeroBattle = new Dictionary <UInt64, HeroBattleInfo>(); //蓝方阵营信息 public string GetGUIDName(UInt64 icon, EntityCampType camp) { if (EntityCampType.CampTypeA == (EntityCampType)camp) { foreach (var battle in AllBlueHeroBattle) { if (icon == battle.Key) { return(battle.Value.HeroName); } } } else { foreach (var battle in AllRedHeroBattle) { if (icon == battle.Key) { return(battle.Value.HeroName); } } } return(null); }
public void SetInfoInit(UInt64 icon, string name, int level, int kills, int death, EntityCampType camp, int campID) { if (GetBlueGuid(icon)) { BattleInfo battle = new BattleInfo(icon, name, level, kills, death, EntityCampType.CampTypeA, campID); AllBlueTeam.Add(battle); SetLevelInfo(icon, level); } }
public virtual Ientity HandleCreateEntity(UInt64 sGUID, EntityCampType campType) {//entity id return(new Ientity(sGUID, campType)); }
public Iplayer(UInt64 sGUID, EntityCampType campType) : base(sGUID, campType) { BattleData = new PlayerBattleData(); }
public Ientity(UInt64 sGUID, EntityCampType campType) { GameObjGUID = sGUID; EntityCamp = campType; m_pcGOSSI = new CGameObjectSyncInfo(); }
public void SetInfoInit(UInt64 icon, string name, int level, int kills, int death, EntityCampType camp) { if (EntityCampType.CampTypeA == (EntityCampType)camp && GetBlueGuid(icon)) { BattleInfo battle = new BattleInfo(icon, name, level, kills, death, EntityCampType.CampTypeA); AllBlueTeam.Add(battle); } else if (EntityCampType.CampTypeB == (EntityCampType)camp && GetRedGuid(icon)) { BattleInfo battle = new BattleInfo(icon, name, level, kills, death, EntityCampType.CampTypeB); AllRedTeam.Add(battle); } SetLevelInfo(icon, level); }
//showInfo public void SetSettlementInfo(UInt64 objGUID, int headID, string nickName, int kills, int death, int asstimes, int level, int totalcp, int lasthit, EntityCampType camp) { SettlementData ssd = new SettlementData(); ssd.Init(objGUID, headID, nickName, level, kills, death, asstimes, totalcp, lasthit, camp); mListMentDate.Add(ssd); }
public INpc(UInt64 sGUID, EntityCampType campType) : base(sGUID, campType) { }
public void AddInitPlayer(UInt64 sGUID, string name, int kills, int death, int Assist, int level, int lastHit, EntityCampType type, int heroid) { HeroBattleInfo HeroBattle = null; Dictionary <UInt64, HeroBattleInfo> heroBattleDic = GetCamp(type); int id = heroid; HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(id); if (info == null) { Debug.LogError("HeroSeletCfg not Find heroId"); return; } if (!heroBattleDic.TryGetValue(sGUID, out HeroBattle)) { HeroBattle = new HeroBattleInfo(); HeroBattle.SGUID = sGUID; HeroBattle.HeroName = name; HeroBattle.Level = level; HeroBattle.Kills = kills; HeroBattle.Deaths = death; HeroBattle.Assist = Assist; HeroBattle.HeadIcon = info.HeroSelectHead; HeroBattle.LastHit = lastHit; HeroBattle.campType = type; SetDic(sGUID, HeroBattle); return; } HeroBattle.SGUID = sGUID; HeroBattle.HeroName = name; HeroBattle.Level = level; HeroBattle.Kills = kills; HeroBattle.Deaths = death; HeroBattle.Assist = Assist; HeroBattle.HeadIcon = info.HeroSelectHead; HeroBattle.LastHit = lastHit; HeroBattle.campType = type; SetDic(sGUID, HeroBattle); }
public void SetKillDeathPlayer(Byte killstate, int campID, UInt64 targetID, UInt64 killID, bool Aced, EHeroKillTitle Title) { MsgInfoManager.eKillMsgType m_type = (eKillMsgType)killstate; string namekill = null; string readXml = null; EntityCampType Type = (EntityCampType)campID; string namedead = null; SetAuido(m_type, Aced); if (Type == EntityCampType.CampTypeBad) { namekill = "中立势力"; readXml = ConfigReader.GetMsgInfo(10009).content; m_type = MsgInfoManager.eKillMsgType.eKillBuild; } else { readXml = ConfigReader.GetMsgInfo(10008).content; } if ((int)campID % 2 == 0) { Type = EntityCampType.CampTypeB; } else { Type = EntityCampType.CampTypeA; } namedead = GetNameGame(targetID); if (namekill == null) { namekill = GetNameGame(killID); } if (namekill != null) { MsgInfoManager.Instance.SetAudioPlay(killID, AudioPlayType.TwentySconde); } else { if (Type == EntityCampType.CampTypeA) { namekill = "精灵势力"; } else { namekill = "亡灵势力"; } m_type = MsgInfoManager.eKillMsgType.eKillBuild; } if (namekill == null || namedead == null || readXml == null) { return; } if (Aced) { MsgInfoManager.Instance.SetKills(m_type, Aced, namekill, namedead, readXml, Title); Aced = false; } MsgInfoManager.Instance.SetKills(m_type, Aced, namekill, namedead, readXml, Title); }
public void SetScoreInfo(UInt64 key, string pszNickName, uint level, uint heroKills, uint deadTimes, EntityCampType Type) { isStartTime = true; ShowScoreDate ssd = new ShowScoreDate(key, pszNickName, (int)level, (int)heroKills, (int)deadTimes, (int)Type); ListDate.Add(ssd); }