//获得某个类型的排队 public QueueLogic GetMatching(QueueRecord tbQueue) { QueueLogic matching; if (!QueueManager.Matchings.TryGetValue(tbQueue.Id, out matching)) { switch ((eQueueType)tbQueue.AppType) { case eQueueType.Dungeon: matching = new FubenQueue(tbQueue.Id); break; case eQueueType.BattleField: matching = new FightQueue(tbQueue.Id); break; case eQueueType.ActivityDungeon: matching = new ActivityFubenQueue(tbQueue.Id); break; } QueueManager.Matchings.Add(tbQueue.Id, matching); QueueManager.RefreshMatchRelation(); } return(matching); }
public void Tick(FubenQueue _this) { var needCount = _this.tbQueue.CountLimit; _this.tempTeam.Clear(); var isCanOver = false; foreach (var mCharacter in _this.mCharacters) { if (mCharacter.mDatas.Count <= needCount) { _this.tempTeam.Add(mCharacter); needCount -= mCharacter.mDatas.Count; if (needCount == 0) { isCanOver = true; break; } } } if (isCanOver) { _this.MatchOver(); } }
//通知匹配成功 public void MatchOver(FubenQueue _this) { foreach (var character in _this.tempTeam) { PlayerLog.WriteLog((int)LogType.QueueMessage, "MatchOver c={0} ids={1}", character.Guid, character.mDatas.Select(d => d.Id).GetDataString()); _this.mCharacters.Remove(character); _this.PushSuccessTime((int)DateTime.Now.GetDiffSeconds(character.StartTime)); } var result = new QueueResult(_this); result.PushCharacter(_this.tempTeam); result.StartTrigger(); _this.tempTeam = new List <QueueCharacter>(); }
public void Construct(FubenQueue _this, int queueId) { }