The War Game Simulation project is a strategic text-based game simulation where two generals compete against each other, commanding armies and managing resources. The goal is to build the largest and best-trained army to defeat the opponent. The application demonstrates the use of key object-oriented programming principles, such as inheritance, polymorphism, and design patterns.
- Generals: Each general manages an army of soldiers and a bag of gold coins. Their goal is to expand and train their army.
- Soldiers: Soldiers have military ranks and experience. A soldier's strength is the product of their rank and experience.
- Maneuvers: A general can order maneuvers, which increase soldiers' experience but cost coins.
- Attack: Generals can attack each other. The winner is determined based on the total strength of the armies. The winner gains gold and experience for their soldiers, while the loser loses gold and experience. In the event of a draw, each general loses a random soldier.
- Recruitment: A general can buy new soldiers who have initial experience.
- Promotion: A soldier is promoted to a higher rank when their experience reaches a certain threshold.
- Save and Load State: A general can save and load the state of their army and resources to/from the disk.
- Reports: The president's secretary monitors the game's progress and generates reports on the generals' actions.
The project was implemented using object-oriented programming principles, and the following are subject to evaluation:
- Class Creation and Composition: The correct design of classes like
General,Soldier, etc. - Inheritance and Polymorphism: The use of inheritance to model hierarchies (e.g., military ranks) and polymorphism to handle different types of soldiers.
- Design Patterns: The application of appropriate design patterns to solve problems within the simulation.
- Algorithms: The implementation of algorithms for combat, maneuvers, and soldier promotion.
- Unit Tests: The project includes unit tests to verify the correctness of the implemented functionalities.
To run the project, follow the standard compilation and execution steps for the programming language used. Ensure that you have the environment and any dependencies configured.
Author: A. Falkowski | Project created as a programming exercise.