The IdleState interface does not seem necessary. Two alternatives:
Make IdleState a dictionary.
Add the fields of IdleState directly to IdleDetector.
The disadvantage of (1) is that interface members should not be dictionaries and so a new getState() method should be added. This adds additional overhead. I prefer option (2).
The
IdleState
interface does not seem necessary. Two alternatives:IdleState
a dictionary.IdleState
directly toIdleDetector
.The disadvantage of (1) is that interface members should not be dictionaries and so a new
getState()
method should be added. This adds additional overhead. I prefer option (2).