From e27f842198b42190ca7a36d8a3ff51be065d5136 Mon Sep 17 00:00:00 2001 From: Cyprien111 <105004796+Cyprien111@users.noreply.github.com> Date: Mon, 7 Apr 2025 08:30:36 +0200 Subject: [PATCH] constructeur dans les humain et ai --- src/GomokuAI.java | 12 ++++++++++++ src/Human.java | 13 +++++++++++++ src/Player.java | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/GomokuAI.java b/src/GomokuAI.java index ce22702..f7d9ceb 100644 --- a/src/GomokuAI.java +++ b/src/GomokuAI.java @@ -5,6 +5,18 @@ import java.util.Random; public class GomokuAI extends Player{ + + //------------------Constructors-------------------------- + + /** + * The constructor of the Human. + * @param name The name of the player. + * @param color The color of the player. + */ + public GomokuAI(String name,Color color){ + super(name,color); + } + /** * This class is an extends of the class Player, this allows the GomokuAI to choose his move. */ diff --git a/src/Human.java b/src/Human.java index c8ab8dd..8ebf06d 100644 --- a/src/Human.java +++ b/src/Human.java @@ -3,6 +3,19 @@ import java.io.Console; public class Human extends Player{ + + + //------------------Constructors-------------------------- + + /** + * The constructor of the Human. + * @param name The name of the player. + * @param color The color of the player. + */ + public Human(String name,Color color){ + super(name,color); + } + /** * This class is an extends of the class Player, this allows the player to choose his move. */ diff --git a/src/Player.java b/src/Player.java index da11404..0b58793 100644 --- a/src/Player.java +++ b/src/Player.java @@ -21,7 +21,7 @@ abstract class Player{ * @param name The name of the player. * @param color The color of the player. */ - public void Player(String name,Color color){ + public Player(String name,Color color){ this.name = name; this.color = color; }