Beispiel #1
0
    //-Removing
    public void removeElementAt(int inIndex, bool inUseSwapRemove = false)
    {
        validateIndex(inIndex);

        int theLastIndex = getSize() - 1;

        if (inUseSwapRemove)
        {
            XUtils.swap(ref _elements[inIndex], ref _elements[theLastIndex]);
        }
        else
        {
            for (int theIndex = inIndex; theIndex < theLastIndex; ++theIndex)
            {
                _elements[theIndex] = _elements[theIndex + 1];
            }
        }
        --_size;

        _validation_changesTracker.increaseChanges();
    }
Beispiel #2
0
 //-Implementation
 //--Utils
 private void normalizeState() {
     if (_state.Minimum > _state.Maximum) {
         XUtils.swap(ref _state.Minimum, ref _state.Maximum);
     }
     setValue(_state.Value);
 }