public void AddGameLayer(GameLayer gameLayer, Boolean active = false) { gameLayer.DependencyInjection(this); _gameLayers.Add(gameLayer); if (active) { ShowScreen(gameLayer); } }
private bool ModifyScreen(string requiredLayerName, bool newActive) { GameLayer screen = _gameLayers.FirstOrDefault(i => i.LayerName == requiredLayerName); if (screen == null) { Console.WriteLine("Name {0} not found", requiredLayerName); return(false); } return(ModifyScreen(screen, newActive)); }
private bool ModifyScreen(GameLayer screen, bool newActive) { if (newActive) { screen.Added(); } else { screen.Removed(); } screen.SetActive(newActive); InitializeWaitingLayers(); return(true); }
public void Remove(GameLayer gameLayer) { _gameLayers.Remove(gameLayer); gameLayer.Dispose(); }
public void SwapScreens(GameLayer one, String twoName) { SwapScreens(one, _gameLayers.FirstOrDefault(i => i.LayerName == twoName)); }
public void SwapScreens(GameLayer one, GameLayer two) { HideScreen(one); ShowScreen(two); }
public bool ShowScreen(GameLayer gameLayer) { return(ModifyScreen(gameLayer, true)); }
public bool HideScreen(GameLayer gameLayer) { return(ModifyScreen(gameLayer, false)); }
public bool HideScreen(GameLayer gameLayer) { return ModifyScreen(gameLayer, false); }
private bool ModifyScreen(GameLayer screen, bool newActive) { if (newActive) { screen.Added(); } else { screen.Removed(); } screen.SetActive(newActive); InitializeWaitingLayers(); return true; }
public bool ShowScreen(GameLayer gameLayer) { return ModifyScreen(gameLayer, true); }