Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategy of loading resources #14

Open
aneteanetes opened this issue May 1, 2023 · 0 comments
Open

Strategy of loading resources #14

aneteanetes opened this issue May 1, 2023 · 0 comments

Comments

@aneteanetes
Copy link
Owner

Info

Need add another loading resources strategy.

Now

In Draw method, each ISceneObject.Image loads from cache "on the fly".
It works good for UI objects like windows (they may not opened at all) and when count of ISceneObject at scene not much.
But its not working for save/load or loading a lot of information from DB (especially, not images).

Proposal

By steps:

  1. Add ISceneObject.LoadResources() method with return type IEnumerable<string> or something
  2. Add IScene.LoadResources() and call it after SceneManager.ChangeScene
  3. In Scene.LoadResources take all created objects (in init method) and call all tree of LoadResources() in each ISceneObject
  4. Load all resources through ResourceManager, for not breaking current logic of loading resource into current IScene

Important

Current pipeline and logic must be save for UI windows or other things with low resources, and for some logic in ISceneObject constructors where ResourceLoader can load some json data - now it's done "in the background".

@aneteanetes aneteanetes changed the title Scene.LoadResources Strategy of loading resources May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant