....how exactly would you build an object-oriented program for it?
Suppose the game has the following basic rules:
1.) Two players
2.) Each player has 10 units that are placed on a grid-like board
3.) Players alternate turns by moving one unit at a time
4.) Units can attack each other (if within range) and deal damage to the units health (unlike in chess where everything is a one-hit kill).
5.) Each unit moves in a unique manner (some can move three spaces, some can move 4, etc.)
What would your object-oriented program look like?
I'm thinking there needs to be the following classes:
Board class, Player class, Game class, Unit class
Where the Game class contains one board and two players. Each Player has ten units.
But, where I get confused, is where do you put the "move" method??????
It seems that the move method should be a part of the Unit class, since each unit possesses the ability to move. But, in order to move, the Unit must have access to the board (to determine where it can move). But I don't see why it would make sense to have every Unit have a board data member. That seems wasteful...or is it?
I really don't know....I'm not much of a programmer, and I know you guys are much more advanced than me. So how exactly would you deal with the move method here?