From c5013649c36d48f48dae4d9a31f867eec37c5a55 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:23:30 +0800 Subject: [PATCH] add set for EcsGroup indexer --- src/Collections/EcsGroup.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Collections/EcsGroup.cs b/src/Collections/EcsGroup.cs index 28f7474..4c80aee 100644 --- a/src/Collections/EcsGroup.cs +++ b/src/Collections/EcsGroup.cs @@ -241,6 +241,17 @@ namespace DCFApixels.DragonECS #endif return _dense[++index]; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set + { + // TODO добавить лок енумератора на изменение +#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS + if (index < 0 || index >= Count) { Throw.ArgumentOutOfRange(); } +#endif + var oldValue = _dense[index]; + _dense[index] = value; + _sparse[oldValue] = 0; + } } #endregion