Skip to content

Instantly share code, notes, and snippets.

@SvDvorak
Last active May 19, 2016 09:40
Show Gist options
  • Save SvDvorak/bcfb728ea137e83ede69e51ec2a301ec to your computer and use it in GitHub Desktop.
Save SvDvorak/bcfb728ea137e83ede69e51ec2a301ec to your computer and use it in GitHub Desktop.
Using extensions to group up systems
public Systems CreateSystems(Pool pool)
{
return SceneSetup.CreateSystem()
.Add(pool.CreateSystem<MoveAndRotateCameraSystem>())
// Adding all animation systems
.AddAnimationSystems(pool)
.Add(pool.CreateSystem<UpdateActingSystem>())
//...
.Add(pool.CreateSystem<DestroySystem>());
}
public static class PoolAnimationSystemsExtensions
{
public static Systems AddAnimationSystems(this Systems systems, Pool pool)
{
return systems
.Add(pool.CreateSystem<RotationAnimationSystem>())
.Add(pool.CreateSystem<MoveAnimationSystem>())
//...
.Add(pool.CreateSystem<ExitGateAnimationSystem>())
.Add(pool.CreateSystem<CurseAnimationSystem>());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment