IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: [Civlike] Anybody see any problems with this structure?
I would think that moving is a function of units, not the map itself. Heck, pathfinding is a sufficently messy problem to warrent it's own class, which would take a map, two locations and a unit. That way you could easily have multiple path finders for different types of movements and units.

LineOfSight could be treated as a specific pathfinding object then. If your going to have some form of fog of war, then you might want to make visibility a map property also, and keep that updated as units are moved. That gets rather mess though if you want to keep seperate maps for different players.

You seem to lack a function to return the value of the attribute. QueryAttribute only tells you if it exists, not what the value is.

Jay

Jay

New It may need it's own class...
but it can be a function of the map. (It's not that hard)

Basically, you use Dijkstra's (or Floyd's) algorithm to find the shortest path - with movement modifiers representing the resistance.

But I'd probably put it in it's own class - only because you want to pass into it the movement types available to the unit so that it can compute shortest possible distance regardless of the type of the unit.
Expand Edited by Simon_Jester May 17, 2003, 11:38:05 AM EDT
Expand Edited by Simon_Jester May 17, 2003, 11:39:54 AM EDT
     [Civlike] Anybody see any problems with this structure? - (inthane-chan) - (12)
         Re: [Civlike] Anybody see any problems with this structure? - (JimWeirich) - (6)
             Agreement - - (Simon_Jester) - (1)
                 That's why City derives from Placeable. - (inthane-chan)
             Thanks. - (inthane-chan) - (2)
                 My 2nd favorite song, Thane. Knew you were cool... :) -NT - (tseliot) - (1)
                     My .sig? Yup, great song. -NT - (inthane-chan)
             Here's one I forgot to mention - (JimWeirich)
         Re: [Civlike] Anybody see any problems with this structure? - (Arkadiy) - (2)
             Good points. Thanks. -NT - (inthane-chan)
             OT: *Great* .sig! (new thread) - (CRConrad)
         Re: [Civlike] Anybody see any problems with this structure? - (JayMehaffey) - (1)
             It may need it's own class... - (Simon_Jester)

Powered by Dorian Gray's picture!
71 ms