Last active
May 19, 2016 09:40
-
-
Save SvDvorak/bcfb728ea137e83ede69e51ec2a301ec to your computer and use it in GitHub Desktop.
Using extensions to group up systems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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