Skip to content

Commit

Permalink
Some small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
genaray committed Aug 13, 2023
1 parent d923c46 commit 66344f7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/Arch/Arch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Nullable>enable</Nullable>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>

<PackageId>Arch</PackageId>
<Title>Arch</Title>
<Version>1.2.6</Version>
<Version>1.2.6.1-alpha</Version>
<Authors>genaray</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Description>A high performance c# net.6 and net.7 archetype based ECS ( Entity component system ).</Description>
<PackageReleaseNotes>Added Entity-Events.
Added Archetype-Edges for faster single Add-Component operations.
Better Component-Registration and methods, now also works for most structs.
Increased performance for lookups and bulk operations due to better shift handling.
Added dangerous utility methods for acessing some internals, this will be used in the serialisation package.
Worlds are now recycled correctly and more efficient due to plain array usage.
CommandBuffer now invokes Events correctly.</PackageReleaseNotes>
<PackageReleaseNotes>Added more dangerous utility methods. </PackageReleaseNotes>
<PackageTags>c#;.net;.net6;.net7;ecs;game;entity;gamedev; game-development; game-engine; entity-component-system;</PackageTags>

<PackageProjectUrl>https://github.com/genaray/Arch</PackageProjectUrl>
Expand All @@ -34,7 +29,6 @@ CommandBuffer now invokes Events correctly.</PackageReleaseNotes>
<LangVersion>11</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Copyright>Apache2.0</Copyright>
<PackageLicenseUrl>https://github.com/genaray/Arch/blob/master/LICENSE.MD</PackageLicenseUrl>

<NoWarn>1701;1702;1591</NoWarn>

Expand Down
9 changes: 9 additions & 0 deletions src/Arch/Core/Archetype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ internal Archetype(ComponentType[] types)
/// The component types that the <see cref="Arch.Core.Entity"/>'s stored here have.
/// </summary>
public ComponentType[] Types { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; }

/// <summary>
/// The lookup array used by this <see cref="Archetype"/>, is being passed to all its <see cref="Chunks"/> to save memory.
/// </summary>
internal int[] LookupArray
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _componentIdToArrayIndex;
}

/// <summary>
/// A bitset representation of the <see cref="Types"/> array for fast lookups and queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class DangerousArchetypeExtensions
/// <param name="archetype">The <see cref="Archetype"/>.</param>
/// <param name="types">The <see cref="ComponentType"/>s.</param>
/// <returns></returns>
public static Archetype CreateArchetype(this Archetype archetype, ComponentType[] types)
public static Archetype CreateArchetype(ComponentType[] types)
{
return new Archetype(types);
}
Expand All @@ -40,4 +40,14 @@ public static void SetChunks(this Archetype archetype, List<Chunk> chunks)
archetype.Chunks = chunks.ToArray();
archetype.Capacity = chunks.Count;
}

/// <summary>
/// Returns the internal lookup array of a <see cref="Archetype"/>.
/// </summary>
/// <param name="archetype">The <see cref="Archetype"/>.</param>
/// <returns>Its lookup array.</returns>
public static int[] GetLookupArray(this Archetype archetype)
{
return archetype.LookupArray;
}
}

0 comments on commit 66344f7

Please sign in to comment.