public override void Initialize() { base.Initialize(); _list = new Algorithms.DataStructures.MyList <int>(); _drawElements = new List <KeyValuePair <int, Entity> >(); _lines = new List <Entity>(); }
private void Clear() { var tmp = _list.ToArray(); foreach (var item in tmp) { _list.RemoveAt(0); _drawElements[0].Value.Transform.TweenScaleTo(Vector2.Zero, 0.5f).Start(); _drawElements[0].Value.Destroy(1); _drawElements.RemoveAt(0); } _list = new MyList <int>(); RemoveAllLines(); }
private void RemoveElementByInd(int ind) { if (!_list.RemoveAt(ind)) { return; } if (_list.IsEmpty) { _list = new MyList <int>(); } _drawElements[ind].Value.Transform.TweenScaleTo(Vector2.Zero, 0.5f).Start(); _drawElements[ind].Value.Destroy(1); _drawElements.RemoveAt(ind); RebuildStructure(); }
private void RemoveElement(int val) { var ind = _list.IndexOf(val); if (ind == null) { return; } _list.RemoveAt(ind.Value); if (_list.IsEmpty) { _list = new MyList <int>(); } _drawElements[ind.Value].Value.Transform.TweenScaleTo(Vector2.Zero, 0.5f).Start(); _drawElements[ind.Value].Value.Destroy(1); _drawElements.RemoveAt(ind.Value); RebuildStructure(); }