chore: Engine Update
This commit is contained in:
parent
b8b10de08a
commit
6c326b1fc6
2
Engine
2
Engine
|
@ -1 +1 @@
|
|||
Subproject commit be06575f913c2b649f53c9fe7a8ed33abdf5734f
|
||||
Subproject commit 2cf6135063b12dfff4d2c8391ad8edde806183f0
|
|
@ -25,9 +25,9 @@ public class GamePong : Game
|
|||
private ShapeBatch shapeBatch = null!;
|
||||
|
||||
private GameManager gameManager = null!;
|
||||
private BehaviourCacher<IDisplayableSprite> displayableCacher = null!;
|
||||
private BehaviourCacher<IDisplayableShape> displayableShapeCacher = null!;
|
||||
private BehaviourCacher<IMonoGameContentLoader> monoGameContentLoaderCacher = null!;
|
||||
private BehaviourCollector<IDisplayableSprite> displayableCollector = null!;
|
||||
private BehaviourCollector<IDisplayableShape> displayableShapeCollector = null!;
|
||||
private BehaviourCollector<IMonoGameContentLoader> monoGameContentLoaderCollector = null!;
|
||||
private MonoGameCamera2DBehaviour cameraBehaviour = null!;
|
||||
|
||||
private PongManagerBehaviour pongManager = null!;
|
||||
|
@ -51,12 +51,12 @@ public class GamePong : Game
|
|||
{
|
||||
// TODO: Add your initialization logic here
|
||||
gameManager = new();
|
||||
displayableCacher = new(gameManager);
|
||||
displayableShapeCacher = new(gameManager);
|
||||
monoGameContentLoaderCacher = new(gameManager);
|
||||
physicsEngine = new PhysicsEngine2DCacher(gameManager) { IterationPerStep = 3 };
|
||||
displayableCollector = new(gameManager);
|
||||
displayableShapeCollector = new(gameManager);
|
||||
monoGameContentLoaderCollector = new(gameManager);
|
||||
physicsEngine = new PhysicsEngine2DCollector(gameManager) { IterationPerStep = 3 };
|
||||
|
||||
monoGameContentLoaderCacher.OnCached += (_, cached) => cached.LoadContent(Content);
|
||||
monoGameContentLoaderCollector.OnCollected += (_, cached) => cached.LoadContent(Content);
|
||||
|
||||
gameManager.Initialize();
|
||||
|
||||
|
@ -182,12 +182,12 @@ public class GamePong : Game
|
|||
gameManager.PreDraw();
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, transformMatrix: cameraBehaviour.MatrixTransform);
|
||||
foreach (var displayable in displayableCacher)
|
||||
foreach (var displayable in displayableCollector)
|
||||
displayable.Draw(spriteBatch);
|
||||
spriteBatch.End();
|
||||
|
||||
shapeBatch.Begin(cameraBehaviour.MatrixTransform);
|
||||
foreach (var displayableShape in displayableShapeCacher)
|
||||
foreach (var displayableShape in displayableShapeCollector)
|
||||
displayableShape.Draw(shapeBatch);
|
||||
shapeBatch.End();
|
||||
|
||||
|
|
Loading…
Reference in New Issue