public void RefreshTimeLine() { IOrderedEnumerable <Fighter> redFighters = Fight.RedTeam.Fighters. OrderByDescending(GetRealInitiative); IOrderedEnumerable <Fighter> blueFighters = Fight.BlueTeam.Fighters. OrderByDescending(GetRealInitiative); bool redFighterFirst = !(Fight.RedTeam.Fighters.Count == 0 || Fight.BlueTeam.Fighters.Count == 0) && GetRealInitiative(redFighters.First()) > GetRealInitiative(blueFighters.First()); IEnumerator <Fighter> redEnumerator = redFighters.GetEnumerator(); IEnumerator <Fighter> blueEnumerator = blueFighters.GetEnumerator(); var timeLine = new List <Fighter>(); bool hasRed; bool hasBlue = false; while ((hasRed = redEnumerator.MoveNext()) || (hasBlue = blueEnumerator.MoveNext())) { if (redFighterFirst) { if (hasRed) { timeLine.Add(redEnumerator.Current); } if (hasBlue) { timeLine.Add(blueEnumerator.Current); } } else { if (hasBlue) { timeLine.Add(blueEnumerator.Current); } if (hasRed) { timeLine.Add(redEnumerator.Current); } } } m_fighters.Clear(); foreach (var fighter in timeLine) { m_fighters.Add(fighter); } }
public override void Dispose() { m_followingCharactersLook.Clear(); m_followingCharactersLook = null; base.Dispose(); }
public void Update(JobDescriptionMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } m_jobs.Clear(); foreach (var job in msg.jobsDescription) { m_jobs.Add(new Job(this, job)); } }
public void Update(EmoteListMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } m_emotes.Clear(); foreach (var emoteId in msg.emoteIds) { m_emotes.Add(ObjectDataManager.Instance.Get <Emoticon>(emoteId)); } }
public void Update(InventoryContentMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } m_items.Clear(); foreach (var item in msg.objects) { m_items.Add(new Item(item)); } }
// Initializes full SpellsBook public void Update(SpellListMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } m_spells.Clear(); foreach (SpellItem spell in msg.spells) { m_spells.Add(new Spell(spell)); } SpellPrevisualization = msg.spellPrevisualization; //FullDump(); }
public void Update(InteractiveElement interactive) { if (interactive == null) { throw new ArgumentNullException("interactive"); } Type = interactive.elementTypeId > 0 ? ObjectDataManager.Instance.Get <Interactive>(interactive.elementTypeId) : null; m_enabledSkills.Clear(); foreach (var skill in interactive.enabledSkills) { m_enabledSkills.Add(new InteractiveSkill(this, skill)); } m_disabledSkills.Clear(); foreach (var skill in interactive.disabledSkills) { m_disabledSkills.Add(new InteractiveSkill(this, skill)); } }
public void Update(ObjectItem item) { if (item == null) { throw new ArgumentNullException("item"); } Guid = item.objectUID; Template = ObjectDataManager.Instance.Get <Protocol.Data.Item>(item.objectGID); m_effects.Clear(); foreach (EffectBase x in item.effects.Select(EffectBase.CreateInstance)) { m_effects.Add(x); } Quantity = item.quantity; PowerRate = item.powerRate; OverMax = item.overMax; Position = (CharacterInventoryPositionEnum)item.position; }
public void Update(Bot bot, MapComplementaryInformationsDataMessage message) { if (message == null) { throw new ArgumentNullException("message"); } SubArea = new SubArea(message.subAreaId) { AlignmentSide = (AlignmentSideEnum)message.subareaAlignmentSide }; ClearActors(); foreach (GameRolePlayActorInformations actor in message.actors) { if (actor.contextualId == bot.Character.Id) { bot.Character.Update(actor as GameRolePlayCharacterInformations); AddActor(bot.Character); } else { AddActor(bot, actor); } } m_interactives.Clear(); foreach (InteractiveElement element in message.interactiveElements) { AddInteractive(new InteractiveObject(this, element)); } foreach (StatedElement element in message.statedElements) { Update(element); } Obstacles = message.obstacles; }
public void Clear() { m_shortcuts.Clear(); }
private void OnClear(object parameter) { m_messages.Clear(); RefreshVisibility(); }
public virtual void ClearActors() { _actors.Clear(); _collectionActors.Clear(); }