From a1f81b0d1505050d1afaecd78aa91a5487a639b7 Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 17 May 2022 09:14:16 +0200 Subject: [PATCH] ADD Player and Score --- src/main/java/latice/model/Player.java | 24 ++++++++++++++++++++++++ src/main/java/latice/model/Score.java | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/main/java/latice/model/Player.java create mode 100644 src/main/java/latice/model/Score.java diff --git a/src/main/java/latice/model/Player.java b/src/main/java/latice/model/Player.java new file mode 100644 index 0000000..0279cdc --- /dev/null +++ b/src/main/java/latice/model/Player.java @@ -0,0 +1,24 @@ +package latice.model; + +import java.util.Scanner; + +public class Player { + private final String name; + private Score score; + + public Player(String name, Score score) { + //Demande le nom du joueur + Scanner enterPlayerName = new Scanner(System.in); + System.out.println("Veuilez entrer votre nom " + name + " :"); + String namePlayer = enterPlayerName.next(); + + this.name = namePlayer; + this.score = score; + } + + public String getName() { + return name; + } + + +} diff --git a/src/main/java/latice/model/Score.java b/src/main/java/latice/model/Score.java new file mode 100644 index 0000000..e9267f2 --- /dev/null +++ b/src/main/java/latice/model/Score.java @@ -0,0 +1,19 @@ +package latice.model; + +public class Score { + private Integer score; + + public Score() { + this.score = 0; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + +}