Skip to content
This repository was archived by the owner on Dec 20, 2019. It is now read-only.

Commands

Ángel Serrano edited this page Feb 17, 2014 · 3 revisions

Commands are the minimum operation to change the model (the game project data). Any change over the game model must be done through commands. This part is used to allow the easy implementation of undo and re-do mechanisms.

All commands must extend Command. Command contains methods the execute and undo the command, and also to combine itself with other commands.

We have atomic commands to change minimum pieces of game model data: FieldCommand, to change a field in any object; MultipleFieldCommand to change several fields at once; MapCommand, to change a map; ListCommand, to change a list, among others.

All commands must be execute through Controller#command(Command).

Commands produce Model Events that can be listened by views.

More info about model events

Clone this wiki locally