Ejemplo n.º 1
0
 public EraseLineService(
     IBoard board,
     BoardPresenter boardPresenter,
     Score score,
     ScorePresenter scorePresenter
     )
 {
     Board          = board;
     BoardPresenter = boardPresenter;
     Score          = score;
     ScorePresenter = scorePresenter;
 }
Ejemplo n.º 2
0
    private void InitializeGameManager()
    {
        lvl            = LvlManager.currentLvl;
        playerProgress = PlayerPrefs.GetInt("PlayerProgress", 0);
        switch (lvl)
        {
        case 0:
            asteroidType = AsteroidType.big;
            break;

        case 1:
            asteroidType = AsteroidType.medium;
            break;

        case 2:
            asteroidType = AsteroidType.small;
            break;

        default:
            asteroidType = AsteroidType.small;
            break;
        }
        points      = new ReactiveProperty <int>(0);
        ssPresenter = new GameObject("SpaceshipPresenter").AddComponent <SpaceshipPresenter>();
        scPresenter = new GameObject("ScorePresenter").AddComponent <ScorePresenter>();
        scPresenter.SubscribeToManager(this);
        bulletPull   = new GameObject("BulletPull").AddComponent <BulletPullPresenter>();
        asteroidPull = new GameObject("AsteroidPull").AddComponent <AsteroidPullPresenter>();
        asteroidPull.asteroidType = this.asteroidType;
        MessageBroker.Default
        .Receive <ScoringNotice>()
        .Subscribe(_ => {
            points.Value += (int)asteroidType;
            if (points.Value >= pointsToWin)
            {
                GameOver(true);
            }
        })
        .AddTo(this);
        StartGame();
    }
Ejemplo n.º 3
0
 public MockScoreView()
 {
     Presenter = new ScorePresenter(this);
 }
Ejemplo n.º 4
0
 public void MyTestInitialize()
 {
     _view = new MockScoreView();
     _presenter = new ScorePresenter(_view);
 }