/// <summary> /// Opens a screen of the provided type with the specified name on the specified layer /// </summary> /// <param name="ScreenType">The C# Type of the screen to instantiate</param> /// <param name="ScreenName">The node name that will be given to the screen</param> /// <param name="ScreenLayer">The layer to open this screen on</param> /// <returns>The intance of the screen or null if it fails</returns> public MDScreen OpenScreen(Type ScreenType, string ScreenName, MDScreenLayer ScreenLayer) { MDScreen NewScreen = MDStatics.CreateTypeInstance <MDScreen>(ScreenType); AddScreenToStack(NewScreen, ScreenLayer); return(NewScreen); }
private void CreateGameClock() { if (GameClock == null) { GameClock = MDStatics.CreateTypeInstance <MDGameClock>(GetGameClockType()); GameClock.Name = "GameClock"; GameSynchronizer.GameClock = GameClock; this.AddNodeToRoot(GameClock, true); } }
// Ensure GameSession is created private void CreateGameSession() { if (GameSession == null) { GameSession = MDStatics.CreateTypeInstance <MDGameSession>(GetGameSessionType()); GameSession.Name = "GameSession"; GameSession.GameInstance = this; this.AddNodeToRoot(GameSession, true); } }
// Ensure Replicator is created private void CreateConfiguration() { if (Configuration == null) { Configuration = MDStatics.CreateTypeInstance <MDConfiguration>(GetConfigurationType()); Configuration.Name = "MDConfiguration"; Configuration.LoadConfiguration(); this.AddNodeToRoot(Configuration, true); } }
// Ensure Replicator is created private void CreateReplicator() { if (Replicator == null) { Replicator = MDStatics.CreateTypeInstance <MDReplicator>(GetReplicatorType()); Replicator.Name = "Replicator"; this.AddNodeToRoot(Replicator, true); Replicator.Initialize(); GameSession.Replicator = Replicator; } }
private void CreateGameSynchronizer() { if (GameSynchronizer == null) { GameSynchronizer = MDStatics.CreateTypeInstance <MDGameSynchronizer>(GetGameSynchronizerType()); GameSynchronizer.Name = "GameSynchronizer"; GameSynchronizer.GameInstance = this; this.AddNodeToRoot(GameSynchronizer, true); // Check if we should create the game clock as well CreateGameClock(); } }