rt

An obligatory Java Project
Log | Files | Refs | LICENSE

commit 2079143ee004ef973c291988e9a214550ac08912
parent 9ba4c0754ad765b86652a775af45b9bba14b53ec
Author: zerous Naveen Narayanan <zerous@nocebo.space>
Date:   Fri, 13 Dec 2019 18:51:00 +0100

Implement a static method getGame() so that multiple groups can play the script at the same time.

Diffstat:
Mserver.java | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/server.java b/server.java @@ -12,6 +12,21 @@ public class server { public static ArrayList<acc> Accounts = new ArrayList<acc>(); public static ArrayList<script> Scripts = new ArrayList<script>(); public static ArrayList<group> Groups = new ArrayList<group>(); + public static ArrayList<game> Games = new ArrayList<game>(); + + public static game getGame(script ms, group mg) { + game gm; + if (Games.isEmpty() == false) + for (game g : Games) { + if (g.isThisMyGame(mg) == true) { + return g; + } + } + gm = new game(ms,mg); + server.Games.add(gm); + + return gm; + } public static void main(String[] args) throws IOException { server.Scripts.add(new script("Dark Knight", "Gordon", "Alfred", 1));