Пример #1
0
 public Handler(IGameSoundPlayer gameSoundPlayer, ICoinBox coinBox, IGame game, IActs acts)
 {
     _gameSoundPlayer = gameSoundPlayer;
     _coinBox         = coinBox;
     _game            = game;
     _acts            = acts;
 }
Пример #2
0
 public StatusPanel(IGameStats gameStats, ICoinBox coinBox)
 {
     _gameStats = gameStats;
     _coinBox   = coinBox;
     // ReSharper disable once HeapView.ObjectAllocation.Evident
     _timer = new LoopingTimer(250.Milliseconds(), () => _tickTock = !_tickTock);
     // ReSharper disable once HeapView.ObjectAllocation.Evident
     _fruit = new SimpleFruit();
 }
Пример #3
0
 public Handler(IGameStats gameStats,
                IMediator mediator,
                ICoinBox coinBox,
                IHaveTheMazeCanvases mazeCanvases)
 {
     _gameStats    = gameStats;
     _mediator     = mediator;
     _coinBox      = coinBox;
     _mazeCanvases = mazeCanvases;
 }
Пример #4
0
        public AttractAct(
            ICoinBox coinBox,
            IMediator mediator,
            IHumanInterfaceParser input,
            IGameSoundPlayer gameSoundPlayer)
        {
            MarqueeText[] texts =
            {
                new MarqueeText
                {
                    Text           = "tap or space for 1 player",
                    YPosition      = 195,
                    TimeIdle       = 1.Seconds(),
                    TimeIn         = 2.Seconds(),
                    TimeStationary = 2.Seconds(),
                    TimeOut        = 1.Seconds()
                },
                new MarqueeText
                {
                    Text           = "press or 2 for 2 players",
                    YPosition      = 195,
                    TimeIdle       = 0.Seconds(),
                    TimeIn         = 2.Seconds(),
                    TimeStationary = 2.Seconds(),
                    TimeOut        = 1.Seconds()
                }
            };

            _marquee         = new Marquee(texts);
            _coinBox         = coinBox;
            _mediator        = mediator;
            _input           = input;
            _gameSoundPlayer = gameSoundPlayer;
            _pacmanLogo      =
                new GeneralSprite(new Vector2(192, 25), new Size(36, 152), Vector2.Zero, new Vector2(456, 173));
            _blazorLogo = new BlazorLogo();

            _instructions = new List <Instruction>();

            _startTime = TimeSpan.MinValue;

            _blinky             = new SimpleGhost(GhostNickname.Blinky, Directions.Right);
            _pinky              = new SimpleGhost(GhostNickname.Pinky, Directions.Right);
            _inky               = new SimpleGhost(GhostNickname.Inky, Directions.Right);
            _clyde              = new SimpleGhost(GhostNickname.Clyde, Directions.Right);
            _startTime          = TimeSpan.MinValue;
            _chaseSubActReadyAt = 9.Seconds();

            _chaseSubAct = new ChaseSubAct();
            _lock        = new object();
        }
Пример #5
0
 public GameAct(
     ICoinBox coinBox,
     IMediator mediator,
     IHumanInterfaceParser input,
     IGameSoundPlayer gameSoundPlayer,
     IGameStats gameStats,
     IGhostCollection ghostCollection,
     IMaze maze,
     IPacMan pacman,
     IFruit fruit)
 {
     _coinBox         = coinBox;
     _mediator        = mediator;
     _input           = input;
     _gameSoundPlayer = gameSoundPlayer;
     _gameStats       = gameStats;
     _ghostCollection = ghostCollection;
     _maze            = maze;
     _pacman          = pacman;
     _fruit           = fruit;
 }
Пример #6
0
 public StartButtonAct(IMediator mediator, IHumanInterfaceParser input, ICoinBox coinBox)
 {
     _mediator = mediator;
     _input    = input;
     _coinBox  = coinBox;
 }
Пример #7
0
    public AttractAct(
        ICoinBox coinBox,
        IMediator mediator,
        IHumanInterfaceParser input,
        IGameSoundPlayer gameSoundPlayer)
    {
        string version = Assembly
                         .GetEntryAssembly()
                         ?.GetCustomAttribute <AssemblyInformationalVersionAttribute>()
                         ?.InformationalVersion ?? "??";

        MarqueeText[] texts =
        {
            new() {
                Text           = $"v{version}",
                YPosition      = 195,
                TimeIdle       = 1.Seconds(),
                TimeIn         = 1.Seconds(),
                TimeStationary = 1.Seconds(),
                TimeOut        = .5f.Seconds()
            },
            new() {
                Text           = "tap/space - 1 player",
                YPosition      = 195,
                TimeIdle       = 1.Seconds(),
                TimeIn         = 2.Seconds(),
                TimeStationary = 2.Seconds(),
                TimeOut        = 1.Seconds()
            },
            new() {
                Text           = "long press/2 - 2 players",
                YPosition      = 195,
                TimeIdle       = 0.Seconds(),
                TimeIn         = 2.Seconds(),
                TimeStationary = 2.Seconds(),
                TimeOut        = 1.Seconds()
            }
        };

        _marquee         = new(texts);
        _coinBox         = coinBox;
        _mediator        = mediator;
        _input           = input;
        _gameSoundPlayer = gameSoundPlayer;
        _pacmanLogo      =
            new(new(192, 25), new(36, 152), Vector2.Zero, new(456, 173));
        _blazorLogo = new();

        _instructions = new();

        _startTime = TimeSpan.MinValue;

        _blinky             = new(GhostNickname.Blinky, Direction.Right);
        _pinky              = new(GhostNickname.Pinky, Direction.Right);
        _inky               = new(GhostNickname.Inky, Direction.Right);
        _clyde              = new(GhostNickname.Clyde, Direction.Right);
        _startTime          = TimeSpan.MinValue;
        _chaseSubActReadyAt = 9.Seconds();

        _chaseSubAct = new();
        _lock        = new();
    }