Compare commits

..

3 Commits

Author SHA1 Message Date
cosmonaut 52d4adf880 fix component remove also removing priority
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-03-12 00:20:43 -08:00
cosmonaut e5c1d7e4c4 forgot to add renderers lol
continuous-integration/drone/push Build is passing Details
2021-02-04 21:04:50 -08:00
cosmonaut 7b747aaec5 get rid of a bunch of interfaces, ordered rendering, streamlined world building, require Adds declaration
continuous-integration/drone/push Build is passing Details
2021-02-04 19:39:58 -08:00
6 changed files with 12 additions and 12 deletions

View File

@ -17,11 +17,11 @@ namespace Encompass
renderers.Add(renderer);
}
public void Draw(double dt, double alpha)
public void Draw()
{
foreach (var renderer in renderers)
{
renderer.Render(dt, alpha);
renderer.Render();
}
}
}

View File

@ -18,7 +18,7 @@ namespace Encompass
_componentManager = componentManager;
}
public abstract void Render(double dt, double alpha);
public abstract void Render();
protected ReadOnlySpan<Entity> ReadEntities<TComponent>() where TComponent : struct
{

View File

@ -20,7 +20,7 @@ namespace Encompass
}
// can't reflect invoke on Span returns...
public override void Render(double dt, double alpha)
public override void Render()
{
foreach (var type in _componentTypes)
{

View File

@ -69,9 +69,9 @@ namespace Encompass
/// <summary>
/// Causes the Renderers to draw.
/// </summary>
public void Draw(double dt, double alpha)
public void Draw()
{
_renderManager.Draw(dt, alpha);
_renderManager.Draw();
}
}
}

View File

@ -474,7 +474,7 @@ namespace Encompass
dummyComponentManager.WriteComponents();
uberRenderer.SetEntity(uberEngine.Entity);
uberRenderer.Render(1, 0);
uberRenderer.Render();
}
}
}

View File

@ -13,7 +13,7 @@ namespace Tests
class TestRenderer : Renderer
{
public override void Render(double dt, double alpha)
public override void Render()
{
ref readonly var entity = ref ReadEntity<AComponent>();
result = (GetComponent<AComponent>(entity), entity);
@ -34,10 +34,10 @@ namespace Tests
var world = worldBuilder.Build();
world.Update(0.01f);
world.Draw(0.01f, 0);
world.Draw();
world.Update(0.01);
world.Draw(0.01f, 0);
world.Draw();
Assert.That(result, Is.EqualTo((aComponent, entity)));
}
@ -59,10 +59,10 @@ namespace Tests
var world = worldBuilder.Build();
world.Update(0.01f);
world.Draw(0.01f, 0);
world.Draw();
world.Update(0.01f);
world.Draw(0.01f, 0);
world.Draw();
Assert.That(result, Is.EqualTo((aComponent, entity)).Or.EqualTo((aComponentTwo, entityB)));
}