package cz.jzitnik.game; import cz.jzitnik.game.sprites.*; import cz.jzitnik.game.sprites.SimpleSprite; import cz.jzitnik.tui.Sprite; import cz.jzitnik.tui.SpriteList; import java.util.HashMap; public class SpriteLoader { public enum SPRITES { // BLOCKS // Blocks AIR, WATER, DIRT, GRASS, STONE, BEDROCK, COBBLESTONE, WOOL, OAK_LOG, OAK_LEAF, OAK_PLANKS, OAK_DOOR, // Ores COAL_ORE, IRON_ORE, GOLD_ORE, DIAMOND_ORE, COAL_BLOCK, IRON_BLOCK, GOLD_BLOCK, DIAMOND_BLOCK, // Work FURNACE, CHEST, CRAFTING_TABLE, BED, // ENTITIES STEVE, PIG, SHEEP, COW, // UI BREAKING, HEART, HUNGER, // ITEMS // Items ITEM_STICK, ITEM_LEATHER, // Block Items ITEM_DIRT, ITEM_OAK_LOG, ITEM_OAK_PLANKS, ITEM_COBBLESTONE, ITEM_STONE, ITEM_OAK_DOOR, ITEM_WOOL, // Ore Items ITEM_COAL_ORE, ITEM_IRON_ORE, ITEM_GOLD_ORE, ITEM_DIAMOND_ORE, ITEM_COAL_BLOCK, ITEM_IRON_BLOCK, ITEM_GOLD_BLOCK, ITEM_DIAMOND_BLOCK, COAL, ITEM_IRON_INGOT, ITEM_GOLD_INGOT, DIAMOND, // Work Items ITEM_CRAFTING_TABLE, ITEM_CHEST, ITEM_FURNACE, ITEM_BED, // Tools WOODEN_SWORD, WOODEN_PICKAXE, WOODEN_AXE, WOODEN_SHOVEL, WOODEN_HOE, STONE_SWORD, STONE_PICKAXE, STONE_AXE, STONE_SHOVEL, STONE_HOE, IRON_SWORD, IRON_PICKAXE, IRON_AXE, IRON_SHOVEL, IRON_HOE, GOLDEN_SWORD, GOLDEN_PICKAXE, GOLDEN_AXE, GOLDEN_SHOVEL, GOLDEN_HOE, DIAMOND_SWORD, DIAMOND_PICKAXE, DIAMOND_AXE, DIAMOND_SHOVEL, DIAMOND_HOE, BUCKET, WATER_BUCKET, LAVA_BUCKET, MILK_BUCKET, // Food ITEM_PORKCHOP, ITEM_COOKED_PORKCHOP, ITEM_MUTTON, ITEM_COOKED_MUTTON, ITEM_BEEF, ITEM_STEAK, } public static final HashMap SPRITES_MAP = new HashMap<>(); static { // BLOCKS // Block SPRITES_MAP.put(SPRITES.AIR, new Air()); SPRITES_MAP.put(SPRITES.WATER, new Water()); SPRITES_MAP.put(SPRITES.DIRT, new SimpleSprite("dirt.ans")); SPRITES_MAP.put(SPRITES.GRASS, new SimpleSprite("grass.ans")); SPRITES_MAP.put(SPRITES.STONE, new SimpleSprite("stone.ans")); SPRITES_MAP.put(SPRITES.BEDROCK, new SimpleSprite("bedrock.ans")); SPRITES_MAP.put(SPRITES.OAK_LOG, new SimpleSprite("oak_log.ans")); SPRITES_MAP.put(SPRITES.OAK_LEAF, new SimpleSprite("oak_leaf.ans")); SPRITES_MAP.put(SPRITES.OAK_PLANKS, new SimpleSprite("oak_planks.ans")); SPRITES_MAP.put(SPRITES.OAK_DOOR, new OakDoor()); SPRITES_MAP.put(SPRITES.WOOL, new Wool()); SPRITES_MAP.put(SPRITES.COBBLESTONE, new SimpleSprite("cobblestone.ans")); // Ores SPRITES_MAP.put(SPRITES.COAL_ORE, new SimpleSprite("coal_ore.ans")); SPRITES_MAP.put(SPRITES.IRON_ORE, new SimpleSprite("iron_ore.ans")); SPRITES_MAP.put(SPRITES.GOLD_ORE, new SimpleSprite("gold_ore.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_ORE, new SimpleSprite("diamond_ore.ans")); SPRITES_MAP.put(SPRITES.COAL_BLOCK, new SimpleSprite("coal_block.ans")); SPRITES_MAP.put(SPRITES.IRON_BLOCK, new SimpleSprite("iron_block.ans")); SPRITES_MAP.put(SPRITES.GOLD_BLOCK, new SimpleSprite("gold_block.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_BLOCK, new SimpleSprite("diamond_block.ans")); //NEWW // Work SPRITES_MAP.put(SPRITES.CRAFTING_TABLE, new SimpleSprite("crafting_table.ans")); SPRITES_MAP.put(SPRITES.FURNACE, new Furnace()); SPRITES_MAP.put(SPRITES.CHEST, new SimpleSprite("chest.ans")); SPRITES_MAP.put(SPRITES.BED, new Bed()); // ENTITIES SPRITES_MAP.put(SPRITES.STEVE, new Steve()); SPRITES_MAP.put(SPRITES.PIG, new Pig()); SPRITES_MAP.put(SPRITES.SHEEP, new Sheep()); SPRITES_MAP.put(SPRITES.COW, new Cow()); // UI SPRITES_MAP.put(SPRITES.BREAKING, new Breaking()); SPRITES_MAP.put(SPRITES.HEART, new Heart()); SPRITES_MAP.put(SPRITES.HUNGER, new Hunger()); // ITEMS // Items SPRITES_MAP.put(SPRITES.ITEM_STICK, new SimpleSprite("items/stick.ans")); SPRITES_MAP.put(SPRITES.ITEM_LEATHER, new SimpleSprite("items/leather.ans")); // Block Items SPRITES_MAP.put(SPRITES.ITEM_DIRT, new SimpleSprite("items/dirt.ans")); SPRITES_MAP.put(SPRITES.ITEM_OAK_LOG, new SimpleSprite("items/oak_log.ans")); SPRITES_MAP.put(SPRITES.ITEM_OAK_PLANKS, new SimpleSprite("items/oak_planks.ans")); SPRITES_MAP.put(SPRITES.ITEM_COBBLESTONE, new SimpleSprite("items/cobblestone.ans")); SPRITES_MAP.put(SPRITES.ITEM_STONE, new SimpleSprite("items/stone.ans")); SPRITES_MAP.put(SPRITES.ITEM_OAK_DOOR, new SimpleSprite("oak_door/items/oak_door.ans")); SPRITES_MAP.put(SPRITES.ITEM_WOOL, new WoolItem()); // Ore Items SPRITES_MAP.put(SPRITES.ITEM_COAL_ORE, new SimpleSprite("items/coal_ore.ans")); SPRITES_MAP.put(SPRITES.ITEM_IRON_ORE, new SimpleSprite("items/iron_ore.ans")); SPRITES_MAP.put(SPRITES.ITEM_GOLD_ORE, new SimpleSprite("items/gold_ore.ans")); SPRITES_MAP.put(SPRITES.ITEM_COAL_BLOCK, new SimpleSprite("items/coal_block.ans")); SPRITES_MAP.put(SPRITES.ITEM_IRON_BLOCK, new SimpleSprite("items/iron_block.ans")); SPRITES_MAP.put(SPRITES.ITEM_GOLD_BLOCK, new SimpleSprite("items/gold_block.ans")); SPRITES_MAP.put(SPRITES.COAL, new SimpleSprite("items/coal.ans")); SPRITES_MAP.put(SPRITES.ITEM_IRON_INGOT, new SimpleSprite("items/iron_ingot.ans")); SPRITES_MAP.put(SPRITES.ITEM_GOLD_INGOT, new SimpleSprite("items/gold_ingot.ans")); // Work Items SPRITES_MAP.put(SPRITES.ITEM_CRAFTING_TABLE, new SimpleSprite("items/crafting_table.ans")); SPRITES_MAP.put(SPRITES.ITEM_CHEST, new SimpleSprite("items/chest.ans")); SPRITES_MAP.put(SPRITES.ITEM_FURNACE, new SimpleSprite("items/furnace.ans")); SPRITES_MAP.put(SPRITES.ITEM_BED, new SimpleSprite("items/bed.ans")); // Tools SPRITES_MAP.put(SPRITES.WOODEN_SWORD, new SimpleSprite("items/wooden_sword.ans")); SPRITES_MAP.put(SPRITES.WOODEN_PICKAXE, new SimpleSprite("items/wooden_pickaxe.ans")); SPRITES_MAP.put(SPRITES.WOODEN_AXE, new SimpleSprite("items/wooden_axe.ans")); SPRITES_MAP.put(SPRITES.WOODEN_SHOVEL, new SimpleSprite("items/wooden_shovel.ans")); SPRITES_MAP.put(SPRITES.WOODEN_HOE, new SimpleSprite("items/wooden_hoe.ans")); SPRITES_MAP.put(SPRITES.STONE_SWORD, new SimpleSprite("items/wooden_sword.ans")); SPRITES_MAP.put(SPRITES.STONE_PICKAXE, new SimpleSprite("items/stone_pickaxe.ans")); SPRITES_MAP.put(SPRITES.STONE_AXE, new SimpleSprite("items/stone_axe.ans")); SPRITES_MAP.put(SPRITES.STONE_SHOVEL, new SimpleSprite("items/stone_shovel.ans")); SPRITES_MAP.put(SPRITES.STONE_HOE, new SimpleSprite("items/stone_hoe.ans")); SPRITES_MAP.put(SPRITES.IRON_SWORD, new SimpleSprite("items/iron_sword.ans")); SPRITES_MAP.put(SPRITES.IRON_PICKAXE, new SimpleSprite("items/iron_pickaxe.ans")); SPRITES_MAP.put(SPRITES.IRON_AXE, new SimpleSprite("items/iron_axe.ans")); SPRITES_MAP.put(SPRITES.IRON_SHOVEL, new SimpleSprite("items/iron_shovel.ans")); SPRITES_MAP.put(SPRITES.IRON_HOE, new SimpleSprite("items/iron_hoe.ans")); SPRITES_MAP.put(SPRITES.GOLDEN_SWORD, new SimpleSprite("items/golden_sword.ans")); SPRITES_MAP.put(SPRITES.GOLDEN_PICKAXE, new SimpleSprite("items/golden_pickaxe.ans")); SPRITES_MAP.put(SPRITES.GOLDEN_AXE, new SimpleSprite("items/golden_axe.ans")); SPRITES_MAP.put(SPRITES.GOLDEN_SHOVEL, new SimpleSprite("items/golden_shovel.ans")); SPRITES_MAP.put(SPRITES.GOLDEN_HOE, new SimpleSprite("items/golden_hoe.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_SWORD, new SimpleSprite("items/diamond_sword.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_PICKAXE, new SimpleSprite("items/diamond_pickaxe.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_AXE, new SimpleSprite("items/diamond_axe.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_SHOVEL, new SimpleSprite("items/diamond_shovel.ans")); SPRITES_MAP.put(SPRITES.DIAMOND_HOE, new SimpleSprite("items/diamond_hoe.ans")); SPRITES_MAP.put(SPRITES.BUCKET, new SimpleSprite("items/bucket.ans")); SPRITES_MAP.put(SPRITES.WATER_BUCKET, new SimpleSprite("items/water_bucket.ans")); SPRITES_MAP.put(SPRITES.LAVA_BUCKET, new SimpleSprite("items/lava_bucket.ans")); SPRITES_MAP.put(SPRITES.MILK_BUCKET, new SimpleSprite("items/milk_bucket.ans")); // Food SPRITES_MAP.put(SPRITES.ITEM_PORKCHOP, new SimpleSprite("items/porkchop.ans")); SPRITES_MAP.put(SPRITES.ITEM_COOKED_PORKCHOP, new SimpleSprite("items/cooked_porkchop.ans")); SPRITES_MAP.put(SPRITES.ITEM_MUTTON, new SimpleSprite("items/mutton.ans")); SPRITES_MAP.put(SPRITES.ITEM_COOKED_MUTTON, new SimpleSprite("items/cooked_mutton.ans")); SPRITES_MAP.put(SPRITES.ITEM_BEEF, new SimpleSprite("items/beef.ans")); SPRITES_MAP.put(SPRITES.ITEM_STEAK, new SimpleSprite("items/steak.ans")); } public static SpriteList load() { return new SpriteList<>(SPRITES.class, SPRITES_MAP); } }