// 카드 변경 void CardChangeMode() { if (!_bDuece) { (Singleton.popUpManager.Get_PopUp("SystemMessage") as SystemMessage).ShowMessage("카드를\n 교체하세요", 1f); } _uiPlayer._SelectCardView.SetSelectCardMode(true); _uiPlayer._BlackSprite.SetActive(false); gameChanged += delegate(GAME_STATE state) // 경기 시작할 때 적 카드 변경 { if (state == GAME_STATE.BATTLE) { _enemyDeck.Get_LeftmostCard().Set_CardType((CARD_TYPE)Random.Range(0, (int)CARD_TYPE.END)); gameChanged -= gameChanged.GetInvocationList()[gameChanged.GetInvocationList().GetLength(0) - 1] as StateChange; } }; }
public void setGameState(Enums.GameState state) { currentGameState = state; if (stateChangeEvent != null) { foreach (var d in stateChangeEvent.GetInvocationList()) { if (d == null) { stateChangeEvent -= (d as StateChange); } } stateChangeEvent(); } }
protected virtual void Dispose(bool disposing) { if (!_Disposed) { _Disposed = true; if (disposing) { if (IsRegistered) { // Unregister the service name. RegistrationManager.Unregister(_InstanceId, _ServiceHandle); // Unregister this server from the context so that it will not receive DDEML callbacks. _Context.UnregisterServer(this); // Indicate that the service name is no longer registered. _ServiceHandle = IntPtr.Zero; _InstanceId = 0; // Raise the StateChange event. foreach (EventHandler handler in StateChange.GetInvocationList()) { try { handler(this, EventArgs.Empty); } catch { // Swallow any exception that occurs. } } } } else { if (IsRegistered) { // Unregister the service name. RegistrationManager.Unregister(_InstanceId, _ServiceHandle); } } } }
private void Dispose(bool disposing) { if (!_Disposed) { _Disposed = true; if (disposing) { // Dispose all clients. foreach (DdemlClient client in _ClientTable.Values) { client.Dispose(); } // Dispose all servers. foreach (DdemlServer server in _ServerTable2.Values) { server.Dispose(); } // Raise the StateChange event. foreach (EventHandler handler in StateChange.GetInvocationList()) { try { handler(this, EventArgs.Empty); } catch { // Swallow any exception that occurs. } } } if (IsInitialized) { // Uninitialize this DDEML instance. InstanceManager.Uninitialize(_InstanceId); // Indicate that this object is no longer initialized. _InstanceId = 0; } } }