diff --git a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java index 632820b..edef7b9 100644 --- a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java +++ b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java @@ -4,9 +4,12 @@ import com.example.cosmosclient.entities.Group; +import java.util.HashMap; + public class Cosmos extends Application { private String token=null; private Group curGroup=null; + private HashMap groups = new HashMap<>(); private String uId=null; //token処理 @@ -18,6 +21,7 @@ } //Group処理 + //再考 public void setCurrentGroup(Group g){ curGroup = g; } @@ -25,6 +29,16 @@ return curGroup; } + public void setGroup(Group g) { + if(groups.get(g.getgId()) == null) { + String newGid = g.getgId(); + groups.put(newGid, g); + } + } + public Group getGroup(String gId) { + return groups.get(gId); + } + //uId処理 public void setuId(String uId){ this.uId = uId;