Пример #1
0
        public void AddActor(Actor ao)
        {
            if (_actors.Count == 0)
            {
                _actors.Add(ao);
                return;
            }

            int index = 0;
            foreach (Actor a in _actors)
            {
                if (a.TotalInitiative >= ao.TotalInitiative)
                {
                    index++;
                }
            }

            if (index == _actors.Count)
            {
                _actors.Add(ao);
            }
            else
            {
                _actors.Insert(index, ao);
            }
        }
Пример #2
0
        public void MoveActor(Actor ao, int index)
        {
            _actors.Remove(ao);

            if (index >= _actors.Count)
            {
                _actors.Add(ao);
            }
            else
            {
                _actors.Insert(index, ao);
            }
        }
Пример #3
0
 public bool RemoveActor(Actor ao)
 {
     return _actors.Remove(ao);
 }