Skip to content

Commit

Permalink
ECS - add EntityData docs
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Aug 1, 2024
1 parent 05d7230 commit 0afa64c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ECS/Entity/EntityData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public readonly ref struct EntityData
[Browse(Never)] public Archetype Archetype => archetype;

/// <summary>Return the <see cref="IComponent"/>'s added to the entity.</summary>
/// <exception cref="NullReferenceException"> if the entity is deleted.</exception>
public EntityComponents Components => new EntityComponents(new Entity(archetype.entityStore, Id));

public override string ToString() => $"Id: {Id}";
Expand All @@ -48,6 +49,7 @@ public readonly ref struct EntityData

#region entity getter
/// <summary> Returns true if the entity contains a component of the specified type. </summary>
/// <exception cref="NullReferenceException"> if the entity is deleted.</exception>
public bool Has<T> () where T : struct, IComponent {
return heapMap[StructInfo<T>.Index] != null;
}
Expand Down

0 comments on commit 0afa64c

Please sign in to comment.