コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public override void Dispose()
        {
            m_followingCharactersLook.Clear();
            m_followingCharactersLook = null;

            base.Dispose();
        }
コード例 #3
0
 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));
     }
 }
コード例 #4
0
 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));
     }
 }
コード例 #5
0
        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));
            }
        }
コード例 #6
0
        // 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();
        }
コード例 #7
0
        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));
            }
        }
コード例 #8
0
ファイル: Item.cs プロジェクト: volgar1x/BehaviorIsManaged
        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;
        }
コード例 #9
0
        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;
        }
コード例 #10
0
 public void Clear()
 {
     m_shortcuts.Clear();
 }
コード例 #11
0
 private void OnClear(object parameter)
 {
     m_messages.Clear();
     RefreshVisibility();
 }
コード例 #12
0
 public virtual void ClearActors()
 {
     _actors.Clear();
     _collectionActors.Clear();
 }