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

Better Model API and DSL for the Storyteller #66

Closed
ThomasAngeliniUnibo opened this issue Feb 5, 2021 · 1 comment
Closed

Better Model API and DSL for the Storyteller #66

ThomasAngeliniUnibo opened this issue Feb 5, 2021 · 1 comment
Assignees
Labels
base structure Build/edit a base feature of the project enhancement New feature or request

Comments

@ThomasAngeliniUnibo
Copy link
Contributor

Better constructor, review if Room has set of ItemRef or Item, evaluate types in package object, ...

@ThomasAngeliniUnibo ThomasAngeliniUnibo created this issue from a note in ScalaQuest Project (Backlog (current Sprint)) Feb 5, 2021
@ThomasAngeliniUnibo ThomasAngeliniUnibo added the base structure Build/edit a base feature of the project label Feb 5, 2021
@maldins46 maldins46 moved this from Backlog (current Sprint) to In progress (current Sprint) in ScalaQuest Project Feb 5, 2021
@maldins46 maldins46 changed the title Review and refactor model Better Model API and DSL for the Storyteller Feb 6, 2021
@maldins46 maldins46 added enhancement New feature or request base structure Build/edit a base feature of the project and removed base structure Build/edit a base feature of the project labels Feb 6, 2021
@maldins46
Copy link
Contributor

Recap of what has been done in be1a66a and 0156835:

  • Clearer Model interface: that means, for example, that querying room.neighbor(direction) returns an actual Room for example. Modifications pass through the Lens, that as opposed to the first case, act directly modifying RoomRef and ItemRef
  • Removed Player and GameState class, now collapsed into State. This was unavoidable at a certain point, as going ahead it becomes impossible to work with Lens, or lens composition, having these entities in separate files
  • General renaming: now, everything that is directly "mixable" into a model ends with "ext", and something more
  • Tried to bring messages outside the state, but revert to the original structure: the main problem here is that reactions can only access the state to do modifications. To have messages and state separated, we should modify Reactions in something like (State,Set[Message) => (State, Set[Message]), and doing some more dirty things in the pipeline/game components;
  • Set Ground as a part of the State: this is conceptually more correct, than having a flying Ground used into the interpreter, for example;
  • For the same reason, now the Interpreter does not takes any argument, except the state. This because recently, both the ground and the dictionary[verb,item] have been inserted into the state. everything is there yet, passing them separately is not necessary anymore.
  • Better organization of factories inside the model (that are builders, actually), following the mixable fashion.
  • override Room's and Item's toString with the name (for utility)
  • made items and rooms comparable beased on refs, overriding ::equals() accordingly. This is not unsafe anymore, as problems with double references have been overcome.

@maldins46 maldins46 pinned this issue Feb 7, 2021
ScalaQuest Project automation moved this from In progress (current Sprint) to Done tasks (current sprint) Feb 10, 2021
@maldins46 maldins46 unpinned this issue Feb 13, 2021
@maldins46 maldins46 moved this from Done tasks (current sprint) to Done tasks (post Sprint) in ScalaQuest Project Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base structure Build/edit a base feature of the project enhancement New feature or request
Projects
ScalaQuest Project
Done tasks (post Sprint)
Development

No branches or pull requests

3 participants