code cleanup

This commit is contained in:
Mikhail 2024-02-26 11:58:19 +08:00
parent 2cbdb4f994
commit 0ed91a08da
6 changed files with 9 additions and 12 deletions

View File

@ -397,7 +397,7 @@ namespace DCFApixels.DragonECS
}
public static TypeMetaDataCached GetCachedTypeMeta(Type type)
{
if(_metaCache.TryGetValue(type, out TypeMetaDataCached result) == false)
if (_metaCache.TryGetValue(type, out TypeMetaDataCached result) == false)
{
result = new TypeMetaDataCached(type);
_metaCache.Add(type, result);
@ -533,7 +533,7 @@ namespace DCFApixels.DragonECS
{
get
{
if(_typeMetaData == null)
if (_typeMetaData == null)
{
_typeMetaData = new TypeMetaData(
Type,

View File

@ -1,9 +1,7 @@
using DCFApixels.DragonECS.Internal;
using DCFApixels.DragonECS.RunnersCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static DCFApixels.DragonECS.EcsDebugUtility;
namespace DCFApixels.DragonECS

View File

@ -36,20 +36,20 @@ namespace DCFApixels.DragonECS
#endregion
}
/// <summary>A pool for struct components.</summary>
public interface IEcsStructPool<T> : IEcsPool where T: struct
public interface IEcsStructPool<T> : IEcsPool where T : struct
{
ref T Add(int entityID);
ref readonly T Read(int entityID);
ref T Get(int entityID);
}
/// <summary>A pool for reference components of type T that instantiates components itself.</summary>
public interface IEcsClassPool<T> : IEcsPool where T: class
public interface IEcsClassPool<T> : IEcsPool where T : class
{
T Add(int entityID);
T Get(int entityID);
}
/// <summary>A pool for reference components of type T, which does not instantiate components itself but receives components from external sources..</summary>
public interface IEcsHybridPool<T> : IEcsPool where T: class
public interface IEcsHybridPool<T> : IEcsPool where T : class
{
void Add(int entityID, T component);
T Get(int entityID);

View File

@ -1,4 +1,3 @@
using DCFApixels.DragonECS.Internal;
using System;
using System.Collections;
using System.Collections.Generic;