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>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

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

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS;
using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal abstract class ComponentStorage
{
public abstract bool Has(int entityID);
@ -104,3 +107,4 @@ internal class ComponentStorage<TComponent> : ComponentStorage where TComponent
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!!
#if DEBUG
using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
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 int ID { get; }
@ -24,3 +26,4 @@ public struct Entity : IEquatable<Entity>
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
{
internal EntityStorage EntityStorage;
@ -77,3 +80,4 @@ public abstract class EntityComponentReader
return RelationDepot.RelatedToB<TRelationKind>(entity.ID);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MoonTools.ECS;
namespace MoonTools.ECS
{
internal class EntityStorage
{
public IDStorage idStorage = new IDStorage();
@ -19,3 +19,4 @@ internal class EntityStorage
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
{
internal FilterSignature Signature;
@ -18,3 +21,4 @@ public class Filter
public int Count => ComponentDepot.FilterCount(this);
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
{
private ComponentDepot ComponentDepot;
@ -39,3 +42,4 @@ public struct FilterBuilder
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
{
private const int HASH_FACTOR = 97;
@ -45,3 +48,4 @@ public struct FilterSignature
return result;
}
}
}

View File

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

View File

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

View File

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

View File

@ -1,5 +1,8 @@
namespace MoonTools.ECS;
using System;
using System.Collections.Generic;
namespace MoonTools.ECS
{
internal class MessageDepot
{
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
{
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
{
internal static class RandomGenerator

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
namespace MoonTools.ECS;
namespace MoonTools.ECS
{
public abstract class Renderer : EntityComponentReader
{
public Renderer(World world)
@ -7,3 +7,4 @@ public abstract class Renderer : EntityComponentReader
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
{
internal MessageDepot MessageDepot;
@ -90,3 +93,4 @@ public abstract class System : EntityComponentReader
EntityStorage.Destroy(entity);
}
}
}

View File

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