예제 #1
0
 public void AddGameLayer(GameLayer gameLayer, Boolean active = false)
 {
     gameLayer.DependencyInjection(this);
     _gameLayers.Add(gameLayer);
     if (active) {
         ShowScreen(gameLayer);
     }
 }
예제 #2
0
 public void AddGameLayer(GameLayer gameLayer, Boolean active = false)
 {
     gameLayer.DependencyInjection(this);
     _gameLayers.Add(gameLayer);
     if (active)
     {
         ShowScreen(gameLayer);
     }
 }
예제 #3
0
        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));
        }
예제 #4
0
 private bool ModifyScreen(GameLayer screen, bool newActive)
 {
     if (newActive)
     {
         screen.Added();
     }
     else
     {
         screen.Removed();
     }
     screen.SetActive(newActive);
     InitializeWaitingLayers();
     return(true);
 }
예제 #5
0
 public void Remove(GameLayer gameLayer)
 {
     _gameLayers.Remove(gameLayer);
     gameLayer.Dispose();
 }
예제 #6
0
 public void SwapScreens(GameLayer one, String twoName)
 {
     SwapScreens(one, _gameLayers.FirstOrDefault(i => i.LayerName == twoName));
 }
예제 #7
0
 public void SwapScreens(GameLayer one, GameLayer two)
 {
     HideScreen(one);
     ShowScreen(two);
 }
예제 #8
0
 public bool ShowScreen(GameLayer gameLayer)
 {
     return(ModifyScreen(gameLayer, true));
 }
예제 #9
0
 public bool HideScreen(GameLayer gameLayer)
 {
     return(ModifyScreen(gameLayer, false));
 }
예제 #10
0
 public void Remove(GameLayer gameLayer)
 {
     _gameLayers.Remove(gameLayer);
     gameLayer.Dispose();
 }
예제 #11
0
 public bool HideScreen(GameLayer gameLayer)
 {
     return ModifyScreen(gameLayer, false);
 }
예제 #12
0
 private bool ModifyScreen(GameLayer screen, bool newActive)
 {
     if (newActive) {
         screen.Added();
     } else {
         screen.Removed();
     }
     screen.SetActive(newActive);
     InitializeWaitingLayers();
     return true;
 }
예제 #13
0
 public void SwapScreens(GameLayer one, String twoName)
 {
     SwapScreens(one, _gameLayers.FirstOrDefault(i => i.LayerName == twoName));
 }
예제 #14
0
 public void SwapScreens(GameLayer one, GameLayer two)
 {
     HideScreen(one);
     ShowScreen(two);
 }
예제 #15
0
 public bool ShowScreen(GameLayer gameLayer)
 {
     return ModifyScreen(gameLayer, true);
 }