caliandro-arturo / ingswAM2021-Caliandro-Converso-DAntini

Windows porting for the board game "Masters of Renaissance".
MIT License
2 stars 1 forks source link

CLI `showUpdate` method not meeting GUI necessities #23

Closed caliandro-arturo closed 3 years ago

caliandro-arturo commented 3 years ago

GUI events such as scene switching (JavaFX) or updates are context dependent. Using a method that receives a String as parameter is good for CLI, where it is enough to change the model and reprint previously-shown elements in order to handle updates (showUpdates in CLI is currently only used for printing textual update notifications).

More specific showUpdate- methods need to be implemented into View class.

ingconti commented 3 years ago

I think is better to use an unified modelling of messages: -all object (java objects of a message class)

OR

debugging will be easier.

caliandro-arturo commented 3 years ago

showUpdate is only used by the client update handler to delegate the printing of a specific text to the view (on CLI), and that text is coded into the same handler, not received from the server.

e.g. (in the update handler):

public void modelElementFooUpdateHandler() {
    instructionsSet();
    showUpdate("the model element Foo has been updated.");
}

But, as said before, this approach cannot be used to show GUI updates.

ingconti commented 3 years ago

yes I understand not sent from server. simply simplicity is from the same logic