This situation must be very frequent:
There are two teams fighting against each other.
They act/fight in turns, i.e. team A - team B - team A - team B - ...
There are different characters who can belong to team A or B
I designed a class CCharacter and a class CTeam (with an array of pointers to the members of the team).
My problem: How can I check by a for loop, whether a character is selected?
There is no general vector array with all characters at the field.
How would you organize this situation and let the teams have their turns alternatively? Is there a general way to manage that?
How to manage team structures and turns?
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: How to manage team structures and turns?
I don't know, because I have no idea what "selected" means in the context of your problem.ehenkes wrote:My problem: How can I check by a for loop, whether a character is selected?
Then there's no way to do it with a single for loop. Do it by looping over each CCharacter in each CTeam, or create another array of all CCharacters. I'm sure you're very well aware of those two possible solutions.ehenkes wrote:There is no general vector array with all characters at the field.
This appears to be a different question. I can't see the connection between "selected" and "turns".ehenkes wrote:How would you organize this situation and let the teams have their turns alternatively?
I doubt it.ehenkes wrote:Is there a general way to manage that?
I also suspect you're thinking out loud, and asking rhetorical questions rather than getting on with just implementing a solution, but then I'm a nasty suspicious hobbitses.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way