public void Dispose() { if (StateHandler == null) { return; } StateHandler.Dispose(); StateHandler = null; }
public void ChangeState(int state, object[] extraArgs) { if (CurrentState == state) { return; } CurrentState = state; if (StateHandler != null) { StateHandler.Dispose(); StateHandler = null; } StateHandler = StateFactory.Create(state, extraArgs); StateHandler.Initialize(); }