Players behavior - using Strategy pattern
Closed this issue · 1 comments
huntertran commented
Implementation of the different player behaviours using the Strategy pattern, where the strategies implement different versions of the reinforcement, attack and fortification as methods of the Player class.
Player Behavior Strategies
- A human player that requires user interaction to make decisions.
- An aggressive computer player strategy that focuses on attack (reinforces its strongest country, then always attack with it until it cannot attack anymore, then fortifies in order to maximize aggregation of forces in one country).
- A benevolent computer player strategy that focuses on protecting its weak countries (reinforces its weakest countries, never attacks, then fortifies in order to move armies to weaker countries).
- A random computer player strategy that reinforces random a random country, attacks a random number of times a random country, and fortifies a random country, all following the standard rules for each phase.
- A cheater computer player strategy whose reinforce() method doubles the number of armies on all its countries, whose attack() method automatically conquers all the neighbors of all its countries, and whose fortify() method doubles the number of armies on its countries that have neighbors that belong to other players.
rogermadhu commented
Note as per professor: Try to fortify countries which are closer to the borders and try to conquer continent so that it can maximize reinforcement army.