Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Game Player
            IGameView      gameView       = new GameFormView();
            Game           gameModel      = new Game();
            GameController gameController = new GameController(gameModel, gameView);
            GameBoardForm  gameBoard      = new GameBoardForm(gameView, gameController);

            // File Handler
            IFiler  filer  = new Filer();
            ISaver  saver  = (ISaver)filer;
            ILoader loader = (ILoader)filer;

            FilerForm       filerView    = new FilerForm();
            IGameFiler      gameFiler    = new GameFiler();
            FilerController filerControl = new FilerController(saver, loader, filer, gameFiler, gameModel, filerView);

            // Level Designer
            ILevelDesignView designView  = new LevelDesignerForm();
            IChecker         designCheck = new Checker();
            ILevelDesigner   designModel = new LevelDesigner(designCheck);

            ILevelDesignController designController = new LevelDesignController(designView, designModel);


            BaseForm baseForm = new BaseForm(gameBoard, filerControl, designController);

            Application.Run(baseForm);
        }
Exemplo n.º 2
0
 public FilerController(ISaver saver, ILoader loader, IFiler filer, IGameFiler gameFileable, Game game, FilerForm view)
 {
     Saver             = saver;
     Loader            = loader;
     View              = view;
     theGame           = game;
     Filer             = filer;
     GameFileable      = gameFileable;
     FileHandled       = new FilerForm.FileEventHandler(OnFileEvent);
     View.FileHandled += FileHandled;
     Filer.CreateSaveFolder();
     View.SetDirectory(Filer.GetSaveLocation());
 }