From f45b9dfb65c7c7b353797eca4be9c2885eb69e85 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 16 Feb 2023 21:11:14 +0900 Subject: Remove unused EMRecipeMap --- .../elementalMatter/core/recipes/EMRecipeMap.java | 73 ---------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java deleted file mode 100644 index 2aad1b9e40..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.github.technus.tectech.mechanics.elementalMatter.core.recipes; - -import java.util.HashMap; -import java.util.Map; - -import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap; -import com.github.technus.tectech.mechanics.elementalMatter.core.maps.IEMMapRead; -import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; -import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack; - -/** - * Created by Tec on 02.03.2017. - */ -public class EMRecipeMap { // TODO FIX - // Multimap for multiple recipes from the same thing - you know parameters might differ the output - - private final Map>> recipes; - - public EMRecipeMap() { - recipes = new HashMap<>(); - } - - public EMRecipe put(EMRecipe in) { - Map> r = getRecipes().computeIfAbsent(in.getInEM(), k -> new HashMap<>()); - return r.put(in.getID(), in); // IF THIS RETURN SHIT, it means that inputs are using the exact same types of - // matter as input - - // (non amount wise collision) - // It is either bad, or unimportant if you use different id's - } - - public void putAll(EMRecipe... contents) { - for (EMRecipe recipe : contents) { - put(recipe); - } - } - - public EMRecipe remove(IEMMapRead map, int id) { - Map> recipesMap = getRecipes().get(map); - return recipesMap != null ? recipesMap.remove(id) : null; // todo check, suspicious but ok, equals and hashcode - // methods are adjusted for that - } - - public Map> remove(IEMMapRead map) { - return getRecipes().remove(map); // todo check, suspicious but ok, equals and hashcode methods are adjusted for - // that - } - - // Recipe founding should not check amounts - this checks if the types of matter in map are equal to any recipe! - // Return a recipeShortMap when the content of input is equal (ignoring amounts and instance data) - @Deprecated - public Map> findExact(IEMMapRead in) { - return getRecipes().get(in); // suspicious but ok, equals and hashcode methods are adjusted for that - } - - // this does check if the map contains all the requirements for any recipe, and the required amounts - // Return a recipeShortMap when the content of input matches the recipe input - does not ignore amounts but ignores - // instance data! - public Map> findMatch(IEMMapRead in) { - for (Map.Entry>> cElementalDefinitionStackMapHashMapEntry : getRecipes() - .entrySet()) { - if (in.containsAllAmounts(cElementalDefinitionStackMapHashMapEntry.getKey())) { - return cElementalDefinitionStackMapHashMapEntry.getValue(); - } - } - return null; - } - - public Map>> getRecipes() { - return recipes; - } - - // To check for instance data and other things use recipe extensions! -} -- cgit