@@ -67,17 +67,39 @@ public HashMap<Long, String> getItems() {
6767 return itemIdToName ;
6868 }
6969
70+ public HashMap <Long , String > getItemsForGame (String game ) {
71+ HashMap <Long , String > ret = new HashMap <>();
72+ for (Map .Entry <String , Game > gameEntry : games .entrySet ()) {
73+ if (!gameEntry .getKey ().equals (game )) continue ;
74+ for (Map .Entry <String , Long > items : gameEntry .getValue ().itemNameToId .entrySet ()) {
75+ ret .put (items .getValue (), items .getKey ());
76+ }
77+ }
78+ return ret ;
79+ }
80+
7081 public HashMap <Long , String > getLocations () {
7182 if (locationIdToName .isEmpty ()) {
7283 for (Map .Entry <String , Game > gameEntry : games .entrySet ()) {
73- for (Map .Entry <String , Long > items : gameEntry .getValue ().locationNameToId .entrySet ()) {
74- itemIdToName .put (items .getValue (), items .getKey ());
84+ for (Map .Entry <String , Long > locations : gameEntry .getValue ().locationNameToId .entrySet ()) {
85+ itemIdToName .put (locations .getValue (), locations .getKey ());
7586 }
7687 }
7788 }
7889 return itemIdToName ;
7990 }
8091
92+ public HashMap <Long , String > getLocationsForGame (String game ) {
93+ HashMap <Long , String > ret = new HashMap <>();
94+ for (Map .Entry <String , Game > gameEntry : games .entrySet ()) {
95+ if (!gameEntry .getKey ().equals (game )) continue ;
96+ for (Map .Entry <String , Long > locations : gameEntry .getValue ().locationNameToId .entrySet ()) {
97+ ret .put (locations .getValue (), locations .getKey ());
98+ }
99+ }
100+ return ret ;
101+ }
102+
81103 public int getVersion () {
82104 return version ;
83105 }
0 commit comments