mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 12:06:37 +00:00
* Tiled Rework * fix failing tests * really fix failing tests
25 lines
681 B
C#
25 lines
681 B
C#
using System;
|
|
using MonoGame.Extended.Particles;
|
|
using MonoGame.Extended.Particles.Modifiers;
|
|
using NUnit.Framework;
|
|
|
|
namespace MonoGame.Extended.Tests.Particles
|
|
{
|
|
internal class AssertionModifier : IModifier
|
|
{
|
|
private readonly Predicate<Particle> _predicate;
|
|
|
|
public AssertionModifier(Predicate<Particle> predicate)
|
|
{
|
|
_predicate = predicate;
|
|
}
|
|
|
|
public unsafe void Update(float elapsedSeconds, ParticleBuffer.ParticleIterator iterator)
|
|
{
|
|
while (iterator.HasNext) {
|
|
var particle = iterator.Next();
|
|
Assert.IsTrue(_predicate(*particle));
|
|
}
|
|
}
|
|
}
|
|
} |