Example #1
0
    /// <summary> All Event Constant values for the savegame </summary>
    public static T[] GetAllEventWork <T>(this IEventWorkArray <T> source) where T : unmanaged
    {
        var result = new T[source.EventWorkCount];

        for (int i = 0; i < result.Length; i++)
        {
            result[i] = source.GetWork(i);
        }
        return(result);
    }
Example #2
0
 /// <summary> All Event Constant values for the savegame </summary>
 public static void SetAllEventWork <T>(this IEventWorkArray <T> source, ReadOnlySpan <T> value) where T : unmanaged
 {
     if (value.Length != source.EventWorkCount)
     {
         return;
     }
     for (int i = 0; i < value.Length; i++)
     {
         source.SetWork(i, value[i]);
     }
 }