Exemplo n.º 1
0
 public ChangeStateGhosts(MenagerGhosts ghosts)
 {
     Ghosts      = ghosts;
     _listoftime = new Queue <int>();
     InitQueue();
     _timer = new Timer(_listoftime.Dequeue());
     State  = new StateScatter();
 }
Exemplo n.º 2
0
        private void Init(int time, Position cherry)
        {
            _status     = GameStatus.NeedInitEvent;
            _defaultMap = (Map)Map.Clone();
            _pacman     = Map.Pacman;
            _pacman.SetTime(time);
            _cherry = new Cherry(cherry, Map);
            _ghosts = new MenagerGhosts(Map, time);

            _pacman.SinkAboutEatEnergizer += _ghosts.AreFrightened;
            _pacman.SinkAboutCreateCherry += () => _cherry.Start();
            _pacman.SinkAboutNextLevel    += NextLevel;
            _pacman.SinkAboutEatGhost     += _ghosts.EatGhost;
            _ghosts.AddSinkAboutEatPacmanHandler(PacmanIsKilled);
        }