Esempio n. 1
0
 static void Main()
 {
     try
     {
         PitchPitch = new PitchPitch();
         PitchPitch.Run();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Properties.Resources.WindowTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Logger.Instance.Log(LogType.Error, ex.Message);
         Logger.Instance.Log(LogType.Info, ex.StackTrace);
     }
 }
Esempio n. 2
0
        public scene.Scene CreateScene(SceneType type, PitchPitch parent, object arg = null)
        {
            if (_scenes == null)
            {
                _scenes = new Dictionary <SceneType, Scene>();
            }

            Scene scene = null;

            if (_scenes.ContainsKey(type))
            {
                scene = _scenes[type];
                switch (type)
                {
                case SceneType.GameStage:
                    (scene as scene.SceneGameStage).Map = arg as map.Map;
                    break;

                case SceneType.Error:
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;
                }
            }
            else
            {
                switch (type)
                {
                case SceneType.Error:
                    scene = new SceneError();
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;

                case SceneType.Title:
                    scene = new SceneTitle();
                    break;

                case SceneType.MapSelect:
                    scene = new SceneMapSelect();
                    break;

                case SceneType.Option:
                    scene = new SceneOption();
                    break;

                case SceneType.GameStage:
                    scene = new SceneGameStage(arg as map.Map);
                    break;

                case SceneType.GameOver:
                    scene = new SceneGameOver();
                    break;

                default:
                    return(null);
                }
                _scenes.Add(type, scene);
            }
            if (scene != null)
            {
                scene.Init(parent);
            }
            return(scene);
        }
Esempio n. 3
0
        public scene.Scene CreateScene(SceneType type, PitchPitch parent, object arg = null)
        {
            if (_scenes == null)
            {
                _scenes = new Dictionary<SceneType, Scene>();
            }

            Scene scene = null;
            if (_scenes.ContainsKey(type))
            {
                scene = _scenes[type];
                switch (type)
                {
                    case SceneType.GameStage:
                        (scene as scene.SceneGameStage).Map = arg as map.Map;
                        break;
                    case SceneType.Error:
                        (scene as scene.SceneError).ErrorMessages = (string[])arg;
                        break;

                }
            }
            else
            {
                switch (type)
                {
                    case SceneType.Error:
                        scene = new SceneError();
                        (scene as scene.SceneError).ErrorMessages = (string[])arg;
                        break;
                    case SceneType.Title:
                        scene = new SceneTitle();
                        break;
                    case SceneType.MapSelect:
                        scene = new SceneMapSelect();
                        break;
                    case SceneType.Option:
                        scene = new SceneOption();
                        break;
                    case SceneType.GameStage:
                        scene = new SceneGameStage(arg as map.Map);
                        break;
                    case SceneType.GameOver:
                        scene = new SceneGameOver();
                        break;
                    default:
                        return null;
                }
                _scenes.Add(type, scene);
            }
            if (scene != null) scene.Init(parent);
            return scene;
        }