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

reduce local state service class size #50

Closed
3 tasks done
ssube opened this issue May 17, 2021 · 0 comments
Closed
3 tasks done

reduce local state service class size #50

ssube opened this issue May 17, 2021 · 0 comments
Assignees
Labels
scope/state world state management status/fixed issues that have been fixed and confirmed type/feature
Milestone

Comments

@ssube
Copy link
Owner

ssube commented May 17, 2021

The local state service is becoming a god class, when it should focus on creating and stepping the world state.

  • the this.focus and this.transfer helpers should be extracted
    • they each have a few methods
    • they both mutate the world state (this.focus sets state.focus.{actor,room} and this.transfer moves entities)
    • this.focus has state of its own: the output buffer for the current step (this.buffer)
  • the createActor/createItem/createRoom methods should be extracted
    • they share a focus on creating an entity from its template
    • they use the Counter, Random, and Template services
  • the gatherPortals/populatePortals/populateRoom methods should be extracted
    • they share a focus on adding new portals to existing rooms
    • they need the Template service + everything createRoom uses
@ssube ssube added status/new issues that have not been addressed yet type/feature scope/state world state management labels May 17, 2021
@ssube ssube added this to the v1.2 milestone May 17, 2021
@ssube ssube self-assigned this May 17, 2021
@ssube ssube added status/progress issues that are in progress status/planned issues that have been planned but not started status/fixed issues that have been fixed and confirmed and removed status/new issues that have not been addressed yet status/progress issues that are in progress status/planned issues that have been planned but not started labels May 18, 2021
@ssube ssube closed this as completed May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/state world state management status/fixed issues that have been fixed and confirmed type/feature
Projects
None yet
Development

No branches or pull requests

1 participant