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 ShapeBatch shapeBatch = null!;
|
||||||
|
|
||||||
private GameManager gameManager = null!;
|
private GameManager gameManager = null!;
|
||||||
private BehaviourCacher<IDisplayableSprite> displayableCacher = null!;
|
private BehaviourCollector<IDisplayableSprite> displayableCollector = null!;
|
||||||
private BehaviourCacher<IDisplayableShape> displayableShapeCacher = null!;
|
private BehaviourCollector<IDisplayableShape> displayableShapeCollector = null!;
|
||||||
private BehaviourCacher<IMonoGameContentLoader> monoGameContentLoaderCacher = null!;
|
private BehaviourCollector<IMonoGameContentLoader> monoGameContentLoaderCollector = null!;
|
||||||
private MonoGameCamera2DBehaviour cameraBehaviour = null!;
|
private MonoGameCamera2DBehaviour cameraBehaviour = null!;
|
||||||
|
|
||||||
private PongManagerBehaviour pongManager = null!;
|
private PongManagerBehaviour pongManager = null!;
|
||||||
|
@ -51,12 +51,12 @@ public class GamePong : Game
|
||||||
{
|
{
|
||||||
// TODO: Add your initialization logic here
|
// TODO: Add your initialization logic here
|
||||||
gameManager = new();
|
gameManager = new();
|
||||||
displayableCacher = new(gameManager);
|
displayableCollector = new(gameManager);
|
||||||
displayableShapeCacher = new(gameManager);
|
displayableShapeCollector = new(gameManager);
|
||||||
monoGameContentLoaderCacher = new(gameManager);
|
monoGameContentLoaderCollector = new(gameManager);
|
||||||
physicsEngine = new PhysicsEngine2DCacher(gameManager) { IterationPerStep = 3 };
|
physicsEngine = new PhysicsEngine2DCollector(gameManager) { IterationPerStep = 3 };
|
||||||
|
|
||||||
monoGameContentLoaderCacher.OnCached += (_, cached) => cached.LoadContent(Content);
|
monoGameContentLoaderCollector.OnCollected += (_, cached) => cached.LoadContent(Content);
|
||||||
|
|
||||||
gameManager.Initialize();
|
gameManager.Initialize();
|
||||||
|
|
||||||
|
@ -182,12 +182,12 @@ public class GamePong : Game
|
||||||
gameManager.PreDraw();
|
gameManager.PreDraw();
|
||||||
|
|
||||||
spriteBatch.Begin(SpriteSortMode.Deferred, transformMatrix: cameraBehaviour.MatrixTransform);
|
spriteBatch.Begin(SpriteSortMode.Deferred, transformMatrix: cameraBehaviour.MatrixTransform);
|
||||||
foreach (var displayable in displayableCacher)
|
foreach (var displayable in displayableCollector)
|
||||||
displayable.Draw(spriteBatch);
|
displayable.Draw(spriteBatch);
|
||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
|
|
||||||
shapeBatch.Begin(cameraBehaviour.MatrixTransform);
|
shapeBatch.Begin(cameraBehaviour.MatrixTransform);
|
||||||
foreach (var displayableShape in displayableShapeCacher)
|
foreach (var displayableShape in displayableShapeCollector)
|
||||||
displayableShape.Draw(shapeBatch);
|
displayableShape.Draw(shapeBatch);
|
||||||
shapeBatch.End();
|
shapeBatch.End();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue