The Model is probably the most complicated object in our project, since it holds all the custom models we will use in
Snakes. We need to design two singleton objects, namely
gestalt. Both are singleton because in
Snakes we need exactly one instance of both. We also need
snakeFactory to construct snake objects. However, as we have already discussed, the latter consists of several parts, therefore, we need to model each of them as well and implement all the necessary factories, since we will need more than one. Because of its complexity, we will only give excerpts of the code here; the complete
Model.scd file can be found online in this book's code bundle.
snake entity is complex, or what we call ...