commit eb09d27914bf44d75e9fe0701124698b0a9219d0
parent 742456d2f846b8f471284b8e5196cf0da7ddf932
Author: zerous Naveen Narayanan <zerous@nocebo.space>
Date: Fri, 13 Dec 2019 18:47:43 +0100
Implement a few things
* Make a copy of group
* Create an new script object and copy roles
* Implement getScript()
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/game.java b/game.java
@@ -5,8 +5,14 @@ public class game {
private group g;
public game(script sc, group gr) {
- g = gr;
- s = sc;
+ try {
+ String[][] roles;
+ g = (group)gr.clone();
+ roles = sc.getRoles();
+ s = new script(roles[0][0], roles[1][0], roles[2][0], sc.getDlevel());
+ } catch (CloneNotSupportedException ex) {
+ System.out.println("CloneNotSupportedException" + ex);
+ }
}
public boolean isThisMyGame(group gr) {
@@ -15,4 +21,8 @@ public class game {
else
return false;
}
+
+ public script getScript() {
+ return s;
+ }
}