refactor: Renamed Cacher to Collector
This commit is contained in:
		@@ -22,8 +22,8 @@ public class GamePong : Game
 | 
			
		||||
    private ShapeBatch shapeBatch = null!;
 | 
			
		||||
 | 
			
		||||
    private GameManager gameManager = null!;
 | 
			
		||||
    private BehaviourCacher<IDisplayableSprite> displayableCacher = null!;
 | 
			
		||||
    private BehaviourCacher<IDisplayableShape> displayableShapeCacher = null!;
 | 
			
		||||
    private BehaviourCollector<IDisplayableSprite> displayableCollector = null!;
 | 
			
		||||
    private BehaviourCollector<IDisplayableShape> displayableShapeCollector = null!;
 | 
			
		||||
    private MonoGameCamera2DBehaviour cameraBehaviour = null!;
 | 
			
		||||
 | 
			
		||||
    private PongManagerBehaviour pongManager = null!;
 | 
			
		||||
@@ -47,9 +47,9 @@ public class GamePong : Game
 | 
			
		||||
    {
 | 
			
		||||
        // TODO: Add your initialization logic here
 | 
			
		||||
        gameManager = new();
 | 
			
		||||
        displayableCacher = new(gameManager);
 | 
			
		||||
        displayableShapeCacher = new(gameManager);
 | 
			
		||||
        physicsEngine = new PhysicsEngine2DCacher(gameManager) { IterationPerStep = 3 };
 | 
			
		||||
        displayableCollector = new(gameManager);
 | 
			
		||||
        displayableShapeCollector = new(gameManager);
 | 
			
		||||
        physicsEngine = new PhysicsEngine2DCollector(gameManager) { IterationPerStep = 3 };
 | 
			
		||||
 | 
			
		||||
        gameManager.Initialize();
 | 
			
		||||
 | 
			
		||||
@@ -154,12 +154,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();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user