Wargame Project Design
The wargame consists of a map to represent the wargame battlefield. The wargame has counters that represent the forces involved in the historic conflict. The wargame is driven by mouse events as the map and counters are selected for action.
The map mouse move event return a hexagon name on the hexagon map. The counter mouse move event returns the counter identifier and its status. The hexagon name is calculated from the hexagon point location with the hexagon name calculator.
The map and counter mouse down events send data to the command generator. The data contains an object identifier and a hexagon location. The hexagon point location is calculated from the screen coordinates with the hexagon point calculator. The hexagon location is a x,y coordinate on the hexagon grid.
The command generator converts the event data into a game command according to the wargames game turn, phase and game mode. This is the sequence of play.
Rules use wargame calculators:
line of sight calculator to calculate range, facing, target angle and los
grid point calculator to calculate adjacent hexagons and hexsides
zone of control calculator to calculate enemy zones of control
stacking calculator to calculate unit stacking requirements in a hexagons
loc calculator to calculate lines of communication
Data is managed by the wargame, force and terrain objects.
Counter are drawn using a SVG (scalable vector graphics) counter generator.