Skip to content

Commit

Permalink
updated csproject
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Apr 28, 2018
1 parent 0b4fdcf commit 83f1a43
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ EntitySet set = world.GetEntities().Without<Example>().Build();
EntitySet set = world.GetEntities().With<Example>().With<int>().Build();
```

EntitySet should be created before entities are instanced.

## Message
It is possible to send and receive message transiting in a World.
```C#
Expand Down
30 changes: 17 additions & 13 deletions source/DefaultEcs/DefaultEcs.csproj
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup Label="Compilation">
<LangVersion>latest</LangVersion>
<TargetFrameworks>
netstandard1.1;
netstandard2.0;
</TargetFrameworks>
<DefineConstants></DefineConstants>
<Optimize>true</Optimize>
<Configurations>Debug;Release</Configurations>

<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\..\ds.snk</AssemblyOriginatorKeyFile>

<Description>DefaultEcs is an Entity Component System framework which aims to be accessible with little constraints while retaining as much performance as possible for game development.</Description>

<Version>0.3.1-alpha</Version>
</PropertyGroup>

<PropertyGroup Label="Package">
<Authors>Paillat Laszlo</Authors>

<PackageId>DefaultEcs</PackageId>
<Description>DefaultEcs is an Entity Component System framework which aims to be accessible with little constraints while retaining as much performance as possible for game development.</Description>
<PackageIconUrl>https://github.com/Doraku/DefaultEcs/raw/master/logo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/Doraku/DefaultEcs</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/Doraku/DefaultEcs/blob/master/LICENSE.md</PackageLicenseUrl>
<PackageId>DefaultEcs</PackageId>
<PackageTags>
gamedev game-development game-engine ecs entity-component-system
</PackageTags>
<PackageIconUrl>https://github.com/Doraku/DefaultEcs/raw/master/logo.png</PackageIconUrl>
</PropertyGroup>

<Version>0.3.2-alpha</Version>
<PackageReleaseNotes>
relaxed the need to create EntitySet before creating Entity
added default value to Entity.Set

fixed leak with EntitySetBuilder
fixed Entity.Remove for multiple entity with the same component
</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Optimize>false</Optimize>
<DefineConstants>DEBUG</DefineConstants>
Expand All @@ -35,7 +40,6 @@
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard1.1'">
<DocumentationFile>bin\DefaultEcs.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.1'">
<PackageReference Include="Vsxmd" Version="1.2.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -47,6 +51,6 @@
</ItemGroup>-->

<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.0-preview1-26216-02" />
<PackageReference Include="System.Memory" Version="4.5.0-preview2-26406-04" />
</ItemGroup>
</Project>
10 changes: 8 additions & 2 deletions source/DefaultEcs/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ static World()
/// Initializes a new instance of the <see cref="World"/> class.
/// </summary>
/// <param name="maxEntityCount">The maximum number of <see cref="Entity"/> that can exist in this <see cref="World"/>.</param>
/// <exception cref="ArgumentException"><paramref name="maxEntityCount"/> cannot be negative.</exception>
public World(int maxEntityCount)
{
if (maxEntityCount < 0)
{
throw new ArgumentException("Argument cannot be negative", nameof(maxEntityCount));
}

_entityIdDispenser = new IntDispenser(-1);
WorldId = _worldIdDispenser.GetFreeInt();

Expand Down Expand Up @@ -145,13 +151,13 @@ public Entity CreateEntity()
/// <typeparam name="T">The type of component.</typeparam>
/// <param name="maxComponentCount">The maximum number of component of type <typeparamref name="T"/> that can exist in this <see cref="World"/>.</param>
/// <returns>The current <see cref="World"/>.</returns>
/// <exception cref="ArgumentException"><paramref name="maxComponentCount"/> can not be negative.</exception>
/// <exception cref="ArgumentException"><paramref name="maxComponentCount"/> cannot be negative.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public World SetComponentTypeMaximumCount<T>(int maxComponentCount)
{
if (maxComponentCount < 0)
{
throw new ArgumentException("Argument can not be negative", nameof(maxComponentCount));
throw new ArgumentException("Argument cannot be negative", nameof(maxComponentCount));
}

ComponentManager<T>.GetOrCreate(WorldId, maxComponentCount);
Expand Down

0 comments on commit 83f1a43

Please sign in to comment.