Exemplo n.º 1
0
        private void InitUnits()
        {
            gameController.CurrentMaze = "0";
            gameData.state.mazes[gameController.CurrentMaze].level = 0;

            gameModel = new GameModel();
            mazeModel = new MazeModel();

            gameModel.AddUnit(pacman = new FakePacmanModel());
            gameModel.AddUnit(blinky = new FakeBlinkyModel());
            gameModel.AddUnit(pinky = new FakePinkyModel());
            gameModel.AddUnit(inky = new FakeInkyModel());
            gameModel.AddUnit(clyde = new FakeClydeModel());

            ((UnitModel)pacman).SetMazeModel(mazeModel);
            ((UnitModel)blinky).SetMazeModel(mazeModel);
            ((UnitModel)pinky).SetMazeModel(mazeModel);
            ((UnitModel)inky).SetMazeModel(mazeModel);
            ((UnitModel)clyde).SetMazeModel(mazeModel);

            gameModel.SetObservation();
        }
Exemplo n.º 2
0
        public void SetMazeModel(MazeModel maze)
        {
            this.maze = maze;

            dotCount = maze.DotCount;

            maze.OnDotCountChanged += DotCountChanged;
            maze.OnEnergizerCollected += SetFrighteningBehaviorMode;
        }