static void UpdateActionArray<T>(ActionSegment<T> sourceActionBuffer, ActionSegment<T> destination)
            where T : struct
        {
            if (sourceActionBuffer.Length <= 0)
            {
                destination.Clear();
            }
            else
            {
                if (sourceActionBuffer.Length != destination.Length)
                {
                    Debug.AssertFormat(sourceActionBuffer.Length == destination.Length,
                        "sourceActionBuffer: {0} is a different size than destination: {1}.",
                        sourceActionBuffer.Length,
                        destination.Length);
                }

                Array.Copy(sourceActionBuffer.Array,
                    sourceActionBuffer.Offset,
                    destination.Array,
                    destination.Offset,
                    destination.Length);
            }
        }
Пример #2
0
 /// <inheritdoc/>
 public bool Equals(ActionSegment <T> other)
 {
     return(Offset == other.Offset && Length == other.Length && Array.SequenceEqual(other.Array));
 }
Пример #3
0
 /// <summary>
 /// Construct an <see cref="ActionBuffers"/> instance with the continuous and discrete actions that will
 /// be used.
 /// </summary>
 /// <param name="continuousActions">The continuous actions to send to an <see cref="IActionReceiver"/>.</param>
 /// <param name="discreteActions">The discrete actions to send to an <see cref="IActionReceiver"/>.</param>
 public ActionBuffers(ActionSegment <float> continuousActions, ActionSegment <int> discreteActions)
 {
     ContinuousActions = continuousActions;
     DiscreteActions   = discreteActions;
 }
Пример #4
0
 /// <inheritdoc cref="IEquatable{T}.Equals(T)"/>
 public bool Equals(ActionSegment <T> other)
 {
     return(Offset == other.Offset && Length == other.Length && Equals(Array, other.Array));
 }