aboutsummaryrefslogtreecommitdiff
path: root/src/main/ScoreController.java
blob: a33c8736ee3f3f54716564002619df679fd8a479 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class ScoreController{

    int score = 0;
    int combo = 0;
    public StringProperty scoreProperty = new SimpleStringProperty("0");
    public StringProperty comboProperty = new SimpleStringProperty("0");

    /**
     * @return current score
     */
    public int getScore()
    {
        return score;
    }

    /**
     * @return current combo
     */
    public int getCombo()
    {
        return combo;
    }

    /**
     * @param newScore: the score to be set
     */
    public void setScore(int newScore)
    {
        score = newScore;
        scoreProperty.setValue(newScore+"");
    }

    /**
     * @param newCombo: the combo to be set
     */
    public void setCombo(int newCombo)
    {
        combo = newCombo;
        comboProperty.setValue(newCombo+"");
    }

    /**
     * prints values into console
     */
    public void print()
    {
        System.out.println("--");
        System.out.println(combo);
        System.out.println(score);
        System.out.println("");
        System.out.println(scoreProperty);
        System.out.println(comboProperty);
    }
}