Skip to content

Commit

Permalink
release 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Dec 15, 2019
1 parent 4dd7334 commit 244fb9d
Show file tree
Hide file tree
Showing 117 changed files with 1,008 additions and 723 deletions.
75 changes: 63 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ DefaultEcs is an [Entity Component System](https://en.wikipedia.org/wiki/Entity_
- [SequentialSystem](#Overview_System_SequentialSystem)
- [AEntitySystem](#Overview_System_AEntitySystem)
- [AComponentSystem](#Overview_System_AComponentSystem)
- [SystemRunner](#Overview_System_SystemRunner)
- [Threading](#Overview_Threading)
- [IParallelRunnable](#Overview_Threading_IParallelRunnable)
- [IParallelRunner](#Overview_Threading_IParallelRunner)
- [DefaultParallelRunner](#Overview_Threading_DefaultParallelRunner)
- [Command](#Overview_Command)
- [Message](#Overview_Message)
- [Serialization](#Overview_Serialization)
Expand Down Expand Up @@ -171,16 +174,16 @@ To perform operation, systems should get EntitySet from the World instance. Enti
EntitySet are created from EntitySetBuilder and it is possible to apply rules for required components or excluded components
```csharp
// this set when enumerated will give all the entities with an Example component
EntitySet set = world.GetEntities().With<Example>().Build();
EntitySet set = world.GetEntities().With<Example>().AsSet();

// this set when enumerated will give all the entities without an Example component
EntitySet set = world.GetEntities().Without<Example>().Build();
EntitySet set = world.GetEntities().Without<Example>().AsSet();

// this set when enumerated will give all the entities with both an Example and an int component
EntitySet set = world.GetEntities().With<Example>().With<int>().Build();
EntitySet set = world.GetEntities().With<Example>().With<int>().AsSet();

// this set when enumerated will give all the entities with either an Example or an int component
EntitySet set = world.GetEntities().WithEither<Example, int>().Build();
EntitySet set = world.GetEntities().WithEither<Example>().Or<int>().AsSet();

// this gives all the component of type Example currently used in the world
Span<Example> components = world.GetAllComponents<Example>();
Expand Down Expand Up @@ -256,7 +259,7 @@ This is a base class to create system to update a given EntitySet.
```csharp
public sealed class VelocitySystem : AEntitySystem<float>
{
public VelocitySystem(World world, SystemRunner<float> runner)
public VelocitySystem(World world, IParallelRunner runner)
: base(world.GetEntities().With<Velocity>().With<Position>().Build(), runner)
{
}
Expand All @@ -280,7 +283,7 @@ It is also possible to declare the needed component by using the WithAttribute a
[With(typeof(Position)]
public sealed class VelocitySystem : AEntitySystem<float>
{
public VelocitySystem(World world, SystemRunner<float> runner)
public VelocitySystem(World world, IParallelRunner runner)
: base(world, runner)
{
}
Expand Down Expand Up @@ -331,25 +334,73 @@ public class DrawSystem : AComponentSystem<float, DrawInfo>
}
```

<a name='Overview_System_SystemRunner'></a>
### SystemRunner
While not directly a system, an instance of this class can be given to base constructor of AEntitySystem and AComponentSystem to provide multithreading processing of system.
<a name='Overview_Threading'></a>
## Threading
Some systems are compatible with multithreading execution: ParallelSystem, AEntitySystem and AComponentSystem. This is done by passing a IParallelRunner to their respective constructor.
```csharp
SystemRunner runner = new SystemRunner(Environment.ProcessorCount);
IParallelRunner runner = new DefaultSystemRunner(Environment.ProcessorCount);

ISystem<float> system = new VelocitySystem(world, runner);

// this will process the update on Environment.ProcessorCount threads
system.Update(elaspedTime);
```

It is safe to run a system with multithreading when:
* for an AEntitySystem
* each entity can be safely updated separately with no dependency to an other entity
* there is no new Set, Remove or Dispose action on entity (only read or update)
* for an AComponentSystem
* each component can be safely updated separately with no dependency to an other component

<a name='Overview_Threading_IParallelRunnable'></a>
### IParallelRunnable
This interface allow the creation of custom parallelisable process by an IParallelRunner.
```csharp
IParallelRunner runner = new DefaultSystemRunner(Environment.ProcessorCount);

public class CustomRunnable : IParallelRunnable
{
public void Run(int index, int maxIndex)
{
// a runnable is separated in maxIndex part to run in parallel, index gives you the part running
}
}

runner.Run(new CustomRunnable());
```

<a name='Overview_Threading_IParallelRunner'></a>
### IParallelRunner
This interface allow the creation of custom parallel execution.
```csharp
IParallelRunner runner = new DefaultSystemRunner(Environment.ProcessorCount);

public class TaskRunner : IParallelRunner
{
int DegreeOfParallelism { get; }

public void Run(IParallelRunnable runnable) Enumerable.Range(0, DegreeOfParallelism).AsParallel().ForAll(i => runnable.Run(i, DegreeOfParallelism));
}
```

<a name='Overview_Threading_DefaultParallelRunner'></a>
### DefaultParallelRunner
This is the default implementation of IParallelRunner. it uses exclusive Task to run an IParallelRunnable and only return when the full runnable has been processed. When `index == maxIndex` this is the calling thread.
It is safe to reuse the same DefaultParallelRunner in multiple system but it should not be used in parallel itself.
```csharp
IParallelRunner runner = new DefaultSystemRunner(Environment.ProcessorCount);

// wrong
ISystem<float> system = new ParallelSystem<float>(runner,
new ParallelSystem1(runner),
new ParallelSystem2(runner));

// ok
ISystem<float> system = new SequentialSystem<float>(
new ParallelSystem1(runner),
new ParallelSystem2(runner));
```

<a name='Overview_Command'></a>
## Command
Since it is not possible to make structural modification on an Entity in a multithreading context, the EntityCommandRecorder type is provided to adress this short-coming.
Expand Down
19 changes: 19 additions & 0 deletions documentation/RELEASENOTE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## DefaultEcs 0.13.0
breaking change:
removed SystemRunner type, use DefaultEcs.Threading.DefaultParallelRunner instead
removed ASystem type
refactored EntitySetBuilder to a more fluent syntax, Build changed to AsSet, *Either&lt;T1, T2&gt;() replaced by *Either&lt;T1&gt;().Or&lt;T2&gt;()

added World.GetDisabledEntities method to create EntitySet for disabled entities
added DisabledAttribute to auto construct EntitySet of disabled entities for AEntitySystem
added EntitySet.Contains method to check for an Entity inclusion
added IParallelRunner to allow custom implementation to process AEntitySystem, AComponentSystem and ParallelSystem in parallel
added Entity.World property

fixed EntityCommandRecorder SetSameAs and Dispose command
fixed size of commands in EntityCommandRecorder
fixed size of Entity
fixed WithoutEitherAttribute filter generation

[nuget package](https://www.nuget.org/packages/DefaultEcs/0.13.0)

## DefaultEcs 0.12.1
fixed serialization of struct as an object
fixed serialization of Type
Expand Down
9 changes: 9 additions & 0 deletions documentation/api/DefaultEcs-Entity-World.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity')
## Entity.World Property
Gets the [World](./DefaultEcs-World.md 'DefaultEcs.World') instance from which current [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') originate.
```C#
public DefaultEcs.World World { get; }
```
#### Returns
[World](./DefaultEcs-World.md 'DefaultEcs.World')
1 change: 1 addition & 0 deletions documentation/api/DefaultEcs-Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ IEquatable<Entity>
Implements [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IEquatable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')
### Properties
- [IsAlive](./DefaultEcs-Entity-IsAlive.md 'DefaultEcs.Entity.IsAlive')
- [World](./DefaultEcs-Entity-World.md 'DefaultEcs.Entity.World')
### Methods
- [CopyTo(DefaultEcs.World)](./DefaultEcs-Entity-CopyTo(DefaultEcs-World).md 'DefaultEcs.Entity.CopyTo(DefaultEcs.World)')
- [Disable()](./DefaultEcs-Entity-Disable().md 'DefaultEcs.Entity.Disable()')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet')
## EntitySet.Contains(DefaultEcs.Entity) Method
Determines whether an [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') is in the [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet').
```C#
public bool Contains(in DefaultEcs.Entity entity);
```
#### Parameters
<a name='DefaultEcs-EntitySet-Contains(DefaultEcs-Entity)-entity'></a>
`entity` [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity')
The [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') to locate in the [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet').

#### Returns
[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')
true if [entity](#DefaultEcs-EntitySet-Contains(DefaultEcs-Entity)-entity 'DefaultEcs.EntitySet.Contains(DefaultEcs.Entity).entity') is found in the [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet'); otherwise, false.
1 change: 1 addition & 0 deletions documentation/api/DefaultEcs-EntitySet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Implements [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/Syst
- [Count](./DefaultEcs-EntitySet-Count.md 'DefaultEcs.EntitySet.Count')
### Methods
- [Complete()](./DefaultEcs-EntitySet-Complete().md 'DefaultEcs.EntitySet.Complete()')
- [Contains(DefaultEcs.Entity)](./DefaultEcs-EntitySet-Contains(DefaultEcs-Entity).md 'DefaultEcs.EntitySet.Contains(DefaultEcs.Entity)')
- [Dispose()](./DefaultEcs-EntitySet-Dispose().md 'DefaultEcs.EntitySet.Dispose()')
- [GetEntities()](./DefaultEcs-EntitySet-GetEntities().md 'DefaultEcs.EntitySet.GetEntities()')
### Events
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder')
## EntitySetBuilder.Build() Method
## EntitySetBuilder.AsSet() Method
Returns an [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet') with the specified rules.
```C#
public DefaultEcs.EntitySet Build();
public DefaultEcs.EntitySet AsSet();
```
#### Returns
[EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.AsSet() Method
Returns an [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet') with the specified rules.
```C#
public DefaultEcs.EntitySet AsSet();
```
#### Returns
[EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet')
The [EntitySet](./DefaultEcs-EntitySet.md 'DefaultEcs.EntitySet').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.Or&lt;T&gt;() Method
Add the type [T](#DefaultEcs-EntitySetBuilder-EitherBuilder-Or-T-()-T 'DefaultEcs.EntitySetBuilder.EitherBuilder.Or&lt;T&gt;().T') to current either group.
```C#
public DefaultEcs.EntitySetBuilder.EitherBuilder Or<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-Or-T-()-T'></a>
`T`
The type of component to add to the either group.

#### Returns
[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
The current [EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenAdded&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when a component of type [T](#DefaultEcs-EntitySetBuilder-EitherBuilder-WhenAdded-T-()-T 'DefaultEcs.EntitySetBuilder.EitherBuilder.WhenAdded&lt;T&gt;().T') is added.
```C#
public DefaultEcs.EntitySetBuilder WhenAdded<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenAdded-T-()-T'></a>
`T`
The type of component.

#### Returns
[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder')
The current [EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenAddedEither&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when one component of the either group is added.
```C#
public DefaultEcs.EntitySetBuilder.EitherBuilder WhenAddedEither<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenAddedEither-T-()-T'></a>
`T`
The type of component to add to the either group.

#### Returns
[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
A [EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder') to create a either group.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenChanged&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when a component of type [T](#DefaultEcs-EntitySetBuilder-EitherBuilder-WhenChanged-T-()-T 'DefaultEcs.EntitySetBuilder.EitherBuilder.WhenChanged&lt;T&gt;().T') is changed.
```C#
public DefaultEcs.EntitySetBuilder WhenChanged<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenChanged-T-()-T'></a>
`T`
The type of component.

#### Returns
[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder')
The current [EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenChangedEither&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when one component of the either group is changed.
```C#
public DefaultEcs.EntitySetBuilder.EitherBuilder WhenChangedEither<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenChangedEither-T-()-T'></a>
`T`
The type of component to add to the either group.

#### Returns
[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
A [EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder') to create a either group.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenRemoved&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when a component of type [T](#DefaultEcs-EntitySetBuilder-EitherBuilder-WhenRemoved-T-()-T 'DefaultEcs.EntitySetBuilder.EitherBuilder.WhenRemoved&lt;T&gt;().T') is removed.
```C#
public DefaultEcs.EntitySetBuilder WhenRemoved<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenRemoved-T-()-T'></a>
`T`
The type of component.

#### Returns
[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder')
The current [EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WhenRemovedEither&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') when one component of the either group is removed.
```C#
public DefaultEcs.EntitySetBuilder.EitherBuilder WhenRemovedEither<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WhenRemovedEither-T-()-T'></a>
`T`
The type of component to add to the either group.

#### Returns
[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
A [EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder') to create a either group.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.With&lt;T&gt;() Method
Makes a rule to observe [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') with a component of type [T](#DefaultEcs-EntitySetBuilder-EitherBuilder-With-T-()-T 'DefaultEcs.EntitySetBuilder.EitherBuilder.With&lt;T&gt;().T').
```C#
public DefaultEcs.EntitySetBuilder With<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-With-T-()-T'></a>
`T`
The type of component.

#### Returns
[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder')
The current [EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs](./DefaultEcs.md 'DefaultEcs').[EntitySetBuilder](./DefaultEcs-EntitySetBuilder.md 'DefaultEcs.EntitySetBuilder').[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
## EitherBuilder.WithEither&lt;T&gt;() Method
Makes a rule to obsverve [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') with at least one component of the either group.
```C#
public DefaultEcs.EntitySetBuilder.EitherBuilder WithEither<T>();
```
#### Type parameters
<a name='DefaultEcs-EntitySetBuilder-EitherBuilder-WithEither-T-()-T'></a>
`T`
The type of component to add to the either group.

#### Returns
[EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder')
A [EitherBuilder](./DefaultEcs-EntitySetBuilder-EitherBuilder.md 'DefaultEcs.EntitySetBuilder.EitherBuilder') to create a either group.
Loading

0 comments on commit 244fb9d

Please sign in to comment.