Open notjuanortiz opened 4 years ago
To differentiate between walking and running, the best approach IMO would be to make use of the State Object design pattern. This also allows us to easily implement other movement states, such as Stunned
, Frozen
, and Snared
, without having to modifying existing states (in theory).
The
WalkingQueue
class does not test well due to the level of cognitive complexity of many methods within the class, which breaks a few SOLID principles.A redesign of the class is necessary if we want to extend the functionality of mobile entities, without introducing more unstable code.
The current functionalities encompassed within this class include: