public override void Start() { base.Start(); m_gameWorldModel = new GameWorldModel(this); m_gameWorldDebug = new GameWorldDebug(this); m_contextOverlayController = new ContextOverlayController(this); gameWorldView.GameWorldController = this; m_chatWindowController = null; gameWorldView.Start(); m_contextOverlayController.Start(gameWorldView.RootWidgetGroup); m_gameWorldModel.Start(); m_gameWorldDebug.Start(); // Ask the server for the complete state of the game m_gameWorldModel.RequestFullGameState(); // $TODO Play title music // Fade in the background m_readyForInput = false; Fader.AttachFaderTo(this.gameObject, Color.black, Fader.eFadeType.fadeIn, 1.0f, () => { m_readyForInput = true; }); }
public ChatWindowModel(ChatWindowController chatWindowController) { _chatWindowController = chatWindowController; _ircSession = null; ChannelOpen = false; }
// Model Event Handlers public void OnGameLoaded() { GameData currentGame = m_gameWorldModel.CurrentGame; CharacterData currentCharacter = currentGame.GetCharacterById(m_gameWorldModel.CurrentCharacterID); RoomKey currentRoomKey = currentCharacter.CurrentRoomKey; // Rebuild all the entities that are part of this room OnRoomLoaded(currentRoomKey); // Roll back the recent events so that the player can see them played back while (m_gameWorldModel.ReverseCurrentEvent(this)) { } m_gameWorldModel.EventPlaybackMode = GameWorldModel.eGameEventMode.playing; gameWorldView.RefreshEventControls(m_gameWorldModel); // Re-Connect to the IRC back-end { if (m_chatWindowController != null) { m_chatWindowController.OnDestroy(); m_chatWindowController = null; } m_chatWindowController = new ChatWindowController(this); m_chatWindowController.Start(gameWorldView.RootWidgetGroup); } }
public override void OnStartClient() { curPos = 0.5f; transform.position = left + ((right - left) * curPos); //find the coordinator and register ourselves (this should happen on server & clients) this.ChatWindow = GameObject.FindGameObjectWithTag("ChatWindow").GetComponent<ChatWindowController>(); this.PongCoordinator = GameObject.FindGameObjectWithTag("GameController").GetComponent<MPPongCoordinator>(); //this code is first executed server-side, and causes the new game to start even before there is a localplayer object //this.PongCoordinator.RegisterPlayer(this); }
public override void OnDestroy() { if (m_chatWindowController != null) { m_chatWindowController.OnDestroy(); m_chatWindowController = null; } m_contextOverlayController.OnDestroy(); m_gameWorldModel.OnDestroy(); gameWorldView.OnDestroy(); m_gameWorldDebug.OnDestroy(); base.OnDestroy(); }
public ChatWindowView(ChatWindowController chatWindowController) { _chatWindowController = chatWindowController; m_chatWindowStyle = chatWindowController.ParentController.chatWindowStyle; }
// Model Event Handlers public void OnGameLoaded() { GameData currentGame = m_gameWorldModel.CurrentGame; CharacterData currentCharacter = currentGame.GetCharacterById( m_gameWorldModel.CurrentCharacterID ); RoomKey currentRoomKey = currentCharacter.CurrentRoomKey; // Rebuild all the entities that are part of this room OnRoomLoaded(currentRoomKey); // Roll back the recent events so that the player can see them played back while (m_gameWorldModel.ReverseCurrentEvent(this)) { } m_gameWorldModel.EventPlaybackMode = GameWorldModel.eGameEventMode.playing; gameWorldView.RefreshEventControls(m_gameWorldModel); // Re-Connect to the IRC back-end { if (m_chatWindowController != null) { m_chatWindowController.OnDestroy(); m_chatWindowController = null; } m_chatWindowController = new ChatWindowController(this); m_chatWindowController.Start(gameWorldView.RootWidgetGroup); } }
private void MainView_Load(object sender, EventArgs e) { displayMessageBox.Text = ""; ChatWindowController.AddFriendTableLayout(tableUserFriendsLayout); }
public ChatWindowView(ChatWindowController chatWindowController) { _chatWindowController = chatWindowController; m_chatWindowStyle= chatWindowController.ParentController.chatWindowStyle; }