/ Projects / Sea Battle Game
(версия для печати)
Sea Battle Game
© P.A. Petroshenko, G.A. Kokneev, A.A. Shalyto
Saint-Petersburg State University of Information Technologies, Mechanics and Optics
The suggested program documentation represents the example of the use of Object-oriented programming with the explicit states evolving under classical «Sea Battle» game version development. The choice of the optimal game algorithm was not the aim of this work.
The documentation consists of the classes diagram, classes block diagrams, automatons communications circuits and transitions graphs, which were created on the program designing stage and were being adjusted during implementation the of the program.
The automatons are realized as the class methods, five of which are automaton classes one automaton per class. Detailed documenting is made only for the automaton classes, while the lists are given for all the classes and the program as a whole.
Four of five automatons are embedded automatons these are invoked from the states of the other automatons. Automatons communicate with each other by nesting and states exchanging and with the application by events processing. There are only two events: «Pressing mouse button» and «Pressing button To start anew».
The protocols, an integral part of this technology, were used in the program debugging. The example the «long» protocol (objects, automatons, input variables, output actions and events are logged) is given.