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); } }
public void MoveActor(Actor ao, int index) { _actors.Remove(ao); if (index >= _actors.Count) { _actors.Add(ao); } else { _actors.Insert(index, ao); } }
public bool RemoveActor(Actor ao) { return _actors.Remove(ao); }