FSO.Files.Formats.IFF.Chunks.TTAB.InsertInteraction C# (CSharp) Method

InsertInteraction() public method

public InsertInteraction ( TTABInteraction action, int index ) : void
action TTABInteraction
index int
return void
        public void InsertInteraction(TTABInteraction action, int index)
        {
            var newInt = new TTABInteraction[Interactions.Length + 1];
            if (index == -1) index = 0;
            Array.Copy(Interactions, newInt, index); //copy before strings
            newInt[index] = action;
            Array.Copy(Interactions, index, newInt, index + 1, (Interactions.Length - index));
            Interactions = newInt;

            if (!InteractionByIndex.ContainsKey(action.TTAIndex)) InteractionByIndex.Add(action.TTAIndex, action);
        }