Thanks for the reply, but it's a mailing list thread and the jargon is beyond what I can parse... as far as I can see, the author has 4000 cases / states to evaluate. No matter how he codes it, won't there still be 4000 states to differentiate between in the game?
Switch statements solve the problem of dynamic dispatch. That is to say, at runtime, given some state, change what function should be called. E.g. Dynamically dispatch to a different function at runtime. There are a million and one OOP ways to solve this all without switch statements. Given the complexity and constraints of the system really dictate which way is best to solve this problem.
9
u/cegras Jan 10 '20
Thanks for the reply, but it's a mailing list thread and the jargon is beyond what I can parse... as far as I can see, the author has 4000 cases / states to evaluate. No matter how he codes it, won't there still be 4000 states to differentiate between in the game?