quote: Original post by Dauntless
so, once I figure out how to implement the order object...and I''m still not sure if I should take Doolwind''s multiple order approach, or your templated approach (since templates are still real fuzzy to me), I''ll have to figure out how to carry the orders to the officer and unit objects.
Dauntless-
If you require multiple messages then I would steer clear of the style I have given. I was talking from a much simpler RTS style where you can give only one order per unit at a time. If this still fits in with what you are planning then perhaps my way would be simpler from a design perspective, but as I was thinking in terms of my own simple C&C clone it is not very scalable. Perhaps a hybrid of what Oluseyi and I have been saying .
For multiple orders (and a more scalable system) I would stick with each unit having a vector of Order''s (which in turn would have their correpsonding actions). This way you can issue as many orders as you like and the unit can still take them on a per-order or even per-action basis and reject or accept them.
To do this you would need to have all of your order objects inheriting from a base "Order" object. This way your vector can contain any type of derirved order object (move, attack, etc).
When a communication token comes in it may have an order or orders imbedded in it and these can then be put into the units order vector.
Doolwind