mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 00:45:34 +00:00
refactor: Replace HashMap with Map in GameConstants & CombineManager
This commit is contained in:
parent
8cdf7a2e85
commit
0b8f9ad851
@ -59,7 +59,7 @@ public final class GameConstants {
|
||||
public static final int[] DEFAULT_ABILITY_HASHES =
|
||||
Arrays.stream(DEFAULT_ABILITY_STRINGS).mapToInt(Utils::abilityHash).toArray();
|
||||
public static final int DEFAULT_ABILITY_NAME = Utils.abilityHash("Default");
|
||||
public static final HashMap<Integer, Integer> YAE_MIKO_ITEM_TO_REGION_COMBINE_BONUS = new HashMap<>() {{
|
||||
public static final Map<Integer, Integer> YAE_MIKO_ITEM_TO_REGION_COMBINE_BONUS = new HashMap<>() {{
|
||||
put(104304, 1);
|
||||
put(104307, 1);
|
||||
put(104310, 2);
|
||||
@ -72,7 +72,7 @@ public final class GameConstants {
|
||||
put(104332, 4);
|
||||
put(104335, 4);
|
||||
}};
|
||||
public static final HashMap<Integer, List<Integer>> YAE_MIKO_REGION_TO_ITEM_COMBINE_BONUS = new HashMap<>() {{
|
||||
public static final Map<Integer, List<Integer>> YAE_MIKO_REGION_TO_ITEM_COMBINE_BONUS = new HashMap<>() {{
|
||||
put(1, List.of(104304, 104307));
|
||||
put(2, List.of(104310, 104313, 104316));
|
||||
put(3, List.of(104320, 104323, 104326));
|
||||
|
@ -128,7 +128,7 @@ public class CombineManger extends BaseGameSystem {
|
||||
player.getInventory().addItem(combineBack);
|
||||
result.getBack().add(combineBack);
|
||||
} else {
|
||||
HashMap<Integer, Integer> mapIdCount = new HashMap<>();
|
||||
Map<Integer, Integer> mapIdCount = new HashMap<>();
|
||||
for (int i = 0; i < luckyCount; i++) {
|
||||
var randomId = combineData
|
||||
.getMaterialItems()
|
||||
@ -152,10 +152,10 @@ public class CombineManger extends BaseGameSystem {
|
||||
// material excluded) when crafting. The rarity is that of the base material."
|
||||
// from wiki
|
||||
// map of material id to region id
|
||||
HashMap<Integer, Integer> itemToRegion = GameConstants.YAE_MIKO_ITEM_TO_REGION_COMBINE_BONUS;
|
||||
Map<Integer, Integer> itemToRegion = GameConstants.YAE_MIKO_ITEM_TO_REGION_COMBINE_BONUS;
|
||||
|
||||
// get list of material id with every region
|
||||
HashMap<Integer, List<Integer>> regionToId = GameConstants.YAE_MIKO_REGION_TO_ITEM_COMBINE_BONUS;
|
||||
Map<Integer, List<Integer>> regionToId = GameConstants.YAE_MIKO_REGION_TO_ITEM_COMBINE_BONUS;
|
||||
|
||||
// check material id in itemToRegion
|
||||
int itemId = combineData.getMaterialItems().get(0).getItemId();
|
||||
|
Loading…
Reference in New Issue
Block a user