remove implicit usings

pull/2/head
cosmonaut 2022-04-07 22:52:03 -07:00
parent 1123ef5662
commit 37d10db955
22 changed files with 781 additions and 721 deletions

View File

@ -2,7 +2,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal class ComponentDepot internal class ComponentDepot
{ {
private Dictionary<Type, ComponentStorage> storages = new Dictionary<Type, ComponentStorage>(); private Dictionary<Type, ComponentStorage> storages = new Dictionary<Type, ComponentStorage>();
@ -257,3 +260,4 @@ internal class ComponentDepot
} }
#endif #endif
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal abstract class ComponentStorage internal abstract class ComponentStorage
{ {
public abstract bool Has(int entityID); public abstract bool Has(int entityID);
@ -104,3 +107,4 @@ internal class ComponentStorage<TComponent> : ComponentStorage where TComponent
return new Entity(entityIDs[0]); return new Entity(entityIDs[0]);
} }
} }
}

View File

@ -1,7 +1,10 @@
// NOTE: these methods are very inefficient // NOTE: these methods are very inefficient
// this class should only be used in debugging contexts!! // this class should only be used in debugging contexts!!
#if DEBUG #if DEBUG
using System;
using System.Collections.Generic;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {
public abstract class DebugSystem : System public abstract class DebugSystem : System

View File

@ -1,5 +1,7 @@
namespace MoonTools.ECS; using System;
namespace MoonTools.ECS
{
public struct Entity : IEquatable<Entity> public struct Entity : IEquatable<Entity>
{ {
public int ID { get; } public int ID { get; }
@ -24,3 +26,4 @@ public struct Entity : IEquatable<Entity>
return ID == other.ID; return ID == other.ID;
} }
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
public abstract class EntityComponentReader public abstract class EntityComponentReader
{ {
internal EntityStorage EntityStorage; internal EntityStorage EntityStorage;
@ -77,3 +80,4 @@ public abstract class EntityComponentReader
return RelationDepot.RelatedToB<TRelationKind>(entity.ID); return RelationDepot.RelatedToB<TRelationKind>(entity.ID);
} }
} }
}

View File

@ -1,5 +1,5 @@
namespace MoonTools.ECS; namespace MoonTools.ECS
{
internal class EntityStorage internal class EntityStorage
{ {
public IDStorage idStorage = new IDStorage(); public IDStorage idStorage = new IDStorage();
@ -19,3 +19,4 @@ internal class EntityStorage
idStorage.Release(entity.ID); idStorage.Release(entity.ID);
} }
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
public class Filter public class Filter
{ {
internal FilterSignature Signature; internal FilterSignature Signature;
@ -18,3 +21,4 @@ public class Filter
public int Count => ComponentDepot.FilterCount(this); public int Count => ComponentDepot.FilterCount(this);
public bool Empty => Count == 0; public bool Empty => Count == 0;
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
public struct FilterBuilder public struct FilterBuilder
{ {
private ComponentDepot ComponentDepot; private ComponentDepot ComponentDepot;
@ -39,3 +42,4 @@ public struct FilterBuilder
return ComponentDepot.CreateFilter(Included, Excluded); return ComponentDepot.CreateFilter(Included, Excluded);
} }
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
public struct FilterSignature public struct FilterSignature
{ {
private const int HASH_FACTOR = 97; private const int HASH_FACTOR = 97;
@ -45,3 +48,4 @@ public struct FilterSignature
return result; return result;
} }
} }
}

View File

@ -1,5 +1,7 @@
namespace MoonTools.ECS; using System.Collections.Generic;
namespace MoonTools.ECS
{
internal class IDStorage internal class IDStorage
{ {
private int nextID = 0; private int nextID = 0;
@ -34,3 +36,4 @@ internal class IDStorage
availableIDHash.Add(id); availableIDHash.Add(id);
} }
} }
}

View File

@ -1,6 +1,7 @@
namespace MoonTools.ECS; namespace MoonTools.ECS
{
public interface IHasEntity public interface IHasEntity
{ {
Entity Entity { get; } Entity Entity { get; }
} }
}

View File

@ -1,4 +1,6 @@
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal class MessageDepot internal class MessageDepot
{ {
private Dictionary<Type, MessageStorage> storages = new Dictionary<Type, MessageStorage>(); private Dictionary<Type, MessageStorage> storages = new Dictionary<Type, MessageStorage>();
@ -57,3 +60,4 @@ internal class MessageDepot
} }
} }
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal abstract class MessageStorage internal abstract class MessageStorage
{ {
public abstract void Clear(); public abstract void Clear();
@ -85,3 +88,4 @@ internal class MessageStorage<TMessage> : MessageStorage where TMessage : struct
} }
} }
} }
}

View File

@ -1,3 +1,6 @@
using System;
using System.Collections.Generic;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {
internal static class RandomGenerator internal static class RandomGenerator

View File

@ -1,3 +1,5 @@
using System;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {
public struct Relation : IEquatable<Relation> public struct Relation : IEquatable<Relation>

View File

@ -1,3 +1,6 @@
using System;
using System.Collections.Generic;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {
internal class RelationDepot internal class RelationDepot

View File

@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace MoonTools.ECS namespace MoonTools.ECS
{ {
internal class RelationStorage internal class RelationStorage

View File

@ -1,5 +1,5 @@
namespace MoonTools.ECS; namespace MoonTools.ECS
{
public abstract class Renderer : EntityComponentReader public abstract class Renderer : EntityComponentReader
{ {
public Renderer(World world) public Renderer(World world)
@ -7,3 +7,4 @@ public abstract class Renderer : EntityComponentReader
world.AddRenderer(this); world.AddRenderer(this);
} }
} }
}

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS; using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
public abstract class System : EntityComponentReader public abstract class System : EntityComponentReader
{ {
internal MessageDepot MessageDepot; internal MessageDepot MessageDepot;
@ -90,3 +93,4 @@ public abstract class System : EntityComponentReader
EntityStorage.Destroy(entity); EntityStorage.Destroy(entity);
} }
} }
}

View File

@ -1,5 +1,5 @@
namespace MoonTools.ECS; namespace MoonTools.ECS
{
public class World public class World
{ {
private readonly EntityStorage EntityStorage = new EntityStorage(); private readonly EntityStorage EntityStorage = new EntityStorage();
@ -47,3 +47,4 @@ public class World
MessageDepot.Clear(); MessageDepot.Clear();
} }
} }
}