public static IEncodedArray <Vector2> CreateVector2SparseArray(MemoryAccessor bottom, IntegerArray topKeys, MemoryAccessor topValues) { Guard.IsTrue(bottom._Attribute.Dimensions == topValues._Attribute.Dimensions, nameof(topValues)); Guard.IsTrue(topKeys.Count <= bottom._Attribute.ItemsCount, nameof(topKeys)); Guard.IsTrue(topKeys.Count == topValues._Attribute.ItemsCount, nameof(topValues)); Guard.IsTrue(topKeys.All(item => item < (uint)bottom._Attribute.ItemsCount), nameof(topKeys)); return(new SparseArray <Vector2>(bottom.AsVector2Array(), topValues.AsVector2Array(), topKeys)); }