diff --git a/src/Collections/EcsSpan.cs b/src/Collections/EcsSpan.cs index 579d916..f45d97c 100644 --- a/src/Collections/EcsSpan.cs +++ b/src/Collections/EcsSpan.cs @@ -28,7 +28,7 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _values.Length; } - public readonly int this[int index] + public int this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _values[index]; diff --git a/src/DataInterfaces.cs b/src/DataInterfaces.cs index ef4ef76..5255dd5 100644 --- a/src/DataInterfaces.cs +++ b/src/DataInterfaces.cs @@ -75,7 +75,7 @@ namespace DCFApixels.DragonECS internal sealed class ComponentResetHandler : IEcsComponentReset where T : IEcsComponentReset { - private T _fakeInstnace; + private T _fakeInstnace = default; [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Reset(ref T component) => _fakeInstnace.Reset(ref component); } diff --git a/src/EcsMask.cs.meta b/src/EcsMask.cs.meta new file mode 100644 index 0000000..c16093c --- /dev/null +++ b/src/EcsMask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1975c74e7ab50e4dba6bf01902e26e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/EcsRunner.cs b/src/EcsRunner.cs index e229c4d..46bdd3f 100644 --- a/src/EcsRunner.cs +++ b/src/EcsRunner.cs @@ -138,12 +138,12 @@ namespace DCFApixels.DragonECS throw new Exception(); } - Type GetRunnerBaseType(Type type) + Type GetRunnerBaseType(Type inType) { - if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(EcsRunner<>)) - return type; - if (type.BaseType != null) - return GetRunnerBaseType(type.BaseType); + if (inType.IsGenericType && inType.GetGenericTypeDefinition() == typeof(EcsRunner<>)) + return inType; + if (inType.BaseType != null) + return GetRunnerBaseType(inType.BaseType); return null; } Type baseType = GetRunnerBaseType(type); @@ -291,7 +291,7 @@ namespace DCFApixels.DragonECS name = Regex.Replace(name, @"\bEcs|Process\b", ""); if (Regex.IsMatch(name, "`\\w{1,}$")) { - var s = name.Split("`"); + var s = name.Split('`'); name = s[0] + $"<{s[1]}>"; } _processes.Add(type, new ProcessInterface(type, name)); diff --git a/src/Utils/ArraySortHalperX.cs.meta b/src/Utils/ArraySortHalperX.cs.meta new file mode 100644 index 0000000..0805127 --- /dev/null +++ b/src/Utils/ArraySortHalperX.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a591de1858028504d819333121bfddd6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Utils/BitsUtility.cs.meta b/src/Utils/BitsUtility.cs.meta new file mode 100644 index 0000000..e87dd37 --- /dev/null +++ b/src/Utils/BitsUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06a40460050b1ef4fa037b3a3cac9a8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Utils/ReadOnlySpanDummy.cs b/src/Utils/ReadOnlySpanDummy.cs index 508b375..43a79a6 100644 --- a/src/Utils/ReadOnlySpanDummy.cs +++ b/src/Utils/ReadOnlySpanDummy.cs @@ -68,12 +68,14 @@ namespace DCFApixels.DragonECS #endregion #region Object +#pragma warning disable CS0809 // Устаревший член переопределяет неустаревший член [Obsolete("Equals() on ReadOnlySpan will always throw an exception. Use the equality operator instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => throw new NotSupportedException(); [Obsolete("GetHashCode() on ReadOnlySpan will always throw an exception.")] [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => throw new NotSupportedException(); +#pragma warning restore CS0809 // Устаревший член переопределяет неустаревший член public override string ToString() { //if (typeof(T) == typeof(char)) @@ -154,6 +156,18 @@ namespace DCFApixels.DragonECS // } // return retVal; //} + public void CopyTo(T[] array) + { + if (_length > array.Length) + { + throw new ArgumentOutOfRangeException(); + } + + for (int i = 0; i < _length; i++) + { + array[i] = _array[i]; + } + } [MethodImpl(MethodImplOptions.AggressiveInlining)] public ReadOnlySpan Slice(int start) diff --git a/src/Utils/UnsafeArray.cs.meta b/src/Utils/UnsafeArray.cs.meta new file mode 100644 index 0000000..fbf882a --- /dev/null +++ b/src/Utils/UnsafeArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d8f3c5034bb040478b60d7421a38ef8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: