Remember to write readable, clean code with object oriented principles. The goal of this challenge is to practice Java OOP concepts while maintaining simplicity.
Beware of over engineering. The hardest thing is to find balance.
Create an army of soldiers with special abilities. Execute commands.
You are going to create an Army with at least 3 different soldiers (i.e. offensive, defensive and adaptable). Soldiers have some common properties like name and damage.
Issue commands to an army. Make defensive soldiers defend and offensive soldiers attack. Have a command which makes everyone reports itself. (Everyone just prints his name). Have any other commands you want. React on each command in your army with different soldiers.
You are going to practice inheritance and polymorphism.
- Have at least 3 types of soldiers
- Each soldier has a special ability which your army can use (i.e. Knights can flank an enemy)
- Have at least 3 different commands
- Have a command - report - which makes everyone just reports itself
Important part of this challenge is how are you going to create classes, interfaces and abstract classes. Commands and soldiers doesn't have to do actually anything, just print something for example.