Commit 7402d2e0 authored by Malo KERVESTIN's avatar Malo KERVESTIN
Browse files

Merge branch 'main' of gitlab.univ-nantes.fr:E188013M/2021-kervestin-rabadan-java into main

parents ae7b57e2 8ca2b40e
*.class
\ No newline at end of file
*.class
.vscode/launch.json
package game;
public class Admin extends Member{
public Admin(String name) {
super(name);
}
}
package game;
public class Member {
protected String name;
public Member(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
......@@ -2,14 +2,13 @@ package game;
import java.util.ArrayList;
public class User {
private String name;
public class User extends Member{
private int balance;
private ArrayList<Card> deck;
private Card[] team;
public User(String name) {
this.name = name;
super(name);
this.balance = 10000;
this.deck = new ArrayList<Card>();
this.team = new Card[4];
......@@ -28,10 +27,6 @@ public class User {
}
}
public String getName() {
return this.name;
}
public void getBalance() {
System.out.println("Your balance is " + balance + " coins");
}
......
......@@ -4,13 +4,14 @@ import java.util.HashMap;
import java.util.Scanner;
import game.Card;
import game.Member;
import game.Pair;
import game.User;
public final class UserController {
private static UserController instance = null;
private HashMap<String, User> users;
private User connectedUser;
private Member connectedUser;
private UserController() {
users = new HashMap<String, User>();
......@@ -41,7 +42,7 @@ public final class UserController {
}
}
public void connect(User user) {
public void connect(Member user) {
if (connectedUser == null) {
this.connectedUser = user;
System.out.println(user.getName() + " is connected");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment