CP could make it a requirement that with any request for having someone doing your homework for you, the name and email of the professor must be specified, so we know where to go to obtain more details about the task.
I know. If you look at the address assignation alone you don’t have a clue what that is (Something = &SomethingElse) you have look at the declaration to figure it out. Sorry if that sounds like repeating the same thing. What I’m saying is that it’s not your C# fire and forget.
Correct, I think. A simple test program would confirm that, but I'm not feeling the urge.
But if you need more than two or three levels of indirection, then the problem space should lead to sensible variable naming. That and intelligent comments should make your intent clear. And, of course, you've got typedefs or C++ using statements to help reduce the brain cramp that I find multiple indirection sometimes brings. If you're using C++, you also have references which might help reduce the (apparent) levels of indirection going on.
I have changed my mind about what I want to ask. I’m not interested in groups anymore.
How do you solve units colliding at all? If it’s just two units is it about where the two units have been ( last visited node ) and where they are traveling towards?
Also what if a unit collides with more than one unit in a short amount of time?
Every move requires distance and direction (target point; angle).
Prior to the actual move, one checks for any units that will be "intersected" by moving to that point. Rectangles have position and size. Rectangles collide when they interest. (Unless rotated, then you need to deal with polygons)
(The actual move is then shortened so you don't "pass through" the target).
The "mover" then is obviously the attacker; the other the defender. If both moving, it was attacking and counter-attaching. The result of a "charge" is a melee or a repulse; followed by a pursuit. There are no "simultaneous" collisions. Any subsquent collisions creates another attacker-defender scenario.
And infantry won't pursue other infantry; they fire them down.
Cavalry will run down (dispersed) infantry.
Cavalry can not be expected to pursue (and catch) other cavalry.
Artillery is unable to "run" without limbering up.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
Last Visit: 31-Dec-99 19:00 Last Update: 8-Dec-23 13:32