Beispiel #1
0
    public virtual void ApplyTo(IScoreHandler toApplyTo)
    {
        switch (changeType)
        {
        case NCOperator.add:
            toApplyTo.score += number;
            return;

        case NCOperator.subtract:
            toApplyTo.score -= number;
            return;

        case NCOperator.multiply:
            toApplyTo.score *= number;
            return;

        case NCOperator.divide:
            toApplyTo.score /= number;
            return;

        case NCOperator.modulo:
            toApplyTo.score %= number;
            return;

        default:
            Debug.LogError("NCOperator " + changeType + " not accounted for.");
            return;
        }
    }
Beispiel #2
0
        public MineFieldScreen(Game game)
            : base(game)
        {
            _field = new MineField(9, 9, 15, true, MinePutterDifficulty.Easy);

            _gameStateManager = new GameStateManager();
            _gameTimeHandler  = new GameTimeHandler(_gameStateManager);
            _scoreHandler     = new ScoreHandlerTextFile("scores.json");
        }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     if (CurrentGame.GetInstance().GetPractice())
     {
         scoreHandler = practiceHandler;
     }
     else if (CurrentGame.GetInstance().GetCrash())
     {
         scoreHandler = crashHandler;
     }
     else
     {
         scoreHandler = raceHandler;
     }
     Debug.Log("race");
Beispiel #4
0
    void Start()
    {
        scoreHandler = GameObject.Find("Score").GetComponent <IScoreHandler>();
        if (scoreHandler != null)
        {
            scoreHandler.OnScoreZero += ClearButtonListener;
        }
        collide = GetComponent <BoxCollider2D>();

        collide.isTrigger = true;

        button = GameObject.FindGameObjectWithTag("Button").GetComponent <Button> ();

        button.onClick.AddListener(() => Magnetic());
    }
Beispiel #5
0
 public void Construct(IScoreHandler scoreHadler)
 {
     this.m_scoreHandleInterface = scoreHadler;
 }