chore: Engine Update

This commit is contained in:
2024-02-09 09:44:25 +03:00
parent b8b10de08a
commit 6c326b1fc6
2 changed files with 11 additions and 11 deletions

2
Engine

Submodule Engine updated: be06575f91...2cf6135063

View File

@@ -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();