This is the main class that controls the flow of the game. It contains all the other manager objects and proivdes a connection between these classes. It also contains the timer and controls the turn
Other than the getter/setter methods GameManager contains some functions that are meant to be used by other classes.
Onless otherwise stated all functions return void
This is the method that initilizes the game, all the parameters other than first, is meant for load game and passed null when a new game is created
stops/continues the timer, use this before opening Joptionpane
Checks if a user is eligible for any bonus, and if it is adds the bonus troops
Data classes, reads a text file containing required information and stores Does not contain any control segment, just acts as a container
Like above these are also data classes and does not contain any decision segment
Stores the current status of the map
initialize a map and distributes the regions randomly among given number of users
It simulates a war between two regions, and returns TroopManager of the winning side As a side effect it kills both parties’ troops. If at the end, both parties go down to 0 troops, then it randomly decides one side as winner and gives 1 infantry
Main screen which all the things are drawn upon.
draws the given panel in the given coordinates
clears everything on the frame
Acts as a container for all the troops residing in a region Provides an interface to add or delete troops Since, it holds a Troop array it is easy to use the manager with other classes
All the classes with Menu suffix accept the Menu.java itself, extends Menu which also extends JPanel.
They all are responsible for drawing the requested Menu and only provide constructor.
This is the class that provides all the interaction in in-game screen It handles the clicks, updates the map and etc.
use it when you need to repaint the map ( for example after some region changes owner)