Elegant Solution for Unit Actions (RTS)

Started by
10 comments, last by Zaei 22 years, 4 months ago
dynamic_cast is evil. That''s no better than having a "Type" enum and putting switch statements everywhere; you might as well be using C. There''s gotta be a better way.
Advertisement
I implemented a State system, so far with a single Movement State, which is working perfectly. All that needs to be done is create a new instance of a state object for the action you want (maybe using a factory, at some point). It works like a charm =).

Z.
______________"Evil is Loud"

This topic is closed to new replies.

Advertisement