public void ChangeState(LoginStateCode eState) { Type type = Type.GetType("GameLogin.State." + eState.ToString()); if (type == null) { ClientLogger.Error("ChangeState:找不到登录状态类型 " + eState.ToString()); return; } LoginStateBase loginStateBase = Activator.CreateInstance(type) as LoginStateBase; if (loginStateBase == null) { ClientLogger.Error("ChangeState:无法实例化登录状态 " + eState.ToString()); return; } this._nextState = loginStateBase; }
public LoginStateBase(LoginStateCode code) { this.LoginCode = code; }
public LoginStateBase(LoginStateCode code, MobaPeerType peer) { this.LoginCode = code; this.PeerType = peer; }