refactor: ContentLoaderCacher Action
This commit is contained in:
parent
d5a904fe8f
commit
70ac012a83
|
@ -56,6 +56,8 @@ public class GamePong : Game
|
||||||
monoGameContentLoaderCacher = new(gameManager);
|
monoGameContentLoaderCacher = new(gameManager);
|
||||||
physicsEngine = new PhysicsEngine2DCacher(gameManager) { IterationPerStep = 3 };
|
physicsEngine = new PhysicsEngine2DCacher(gameManager) { IterationPerStep = 3 };
|
||||||
|
|
||||||
|
monoGameContentLoaderCacher.OnCached += (_, cached) => cached.LoadContent(Content);
|
||||||
|
|
||||||
gameManager.Initialize();
|
gameManager.Initialize();
|
||||||
|
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
@ -156,11 +158,6 @@ public class GamePong : Game
|
||||||
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect("127.0.0.1", 8888);
|
pongManager.BehaviourController.AddBehaviour<NetworkClient>().Connect("127.0.0.1", 8888);
|
||||||
Window.Title = $"Pong - Client -> 127.0.0.1";
|
Window.Title = $"Pong - Client -> 127.0.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var contentLoader in monoGameContentLoaderCacher)
|
|
||||||
{
|
|
||||||
contentLoader.LoadContent(Content);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime)
|
protected override void Update(GameTime gameTime)
|
||||||
|
|
Loading…
Reference in New Issue