From 75d3d9c340d5589b23fa746118050150726636c7 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 31 Aug 2022 03:15:11 +0600 Subject: Items --- .../com/ilotterytea/maxoning/player/MaxonItem.java | 19 +++++++++++++ .../ilotterytea/maxoning/player/MaxonItemEnum.java | 7 +++++ .../maxoning/player/MaxonItemRegister.java | 31 ++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 core/src/com/ilotterytea/maxoning/player/MaxonItem.java create mode 100644 core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java create mode 100644 core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java (limited to 'core/src/com') diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItem.java b/core/src/com/ilotterytea/maxoning/player/MaxonItem.java new file mode 100644 index 0000000..b7347ef --- /dev/null +++ b/core/src/com/ilotterytea/maxoning/player/MaxonItem.java @@ -0,0 +1,19 @@ +package com.ilotterytea.maxoning.player; + +import com.ilotterytea.maxoning.ui.AnimatedImage; + +public class MaxonItem { + public String name; + public String desc; + public AnimatedImage icon; + public MaxonItemEnum type; + public float price; + + public MaxonItem(String name, String desc, AnimatedImage icon, MaxonItemEnum type, float price) { + this.name = name; + this.desc = desc; + this.icon = icon; + this.type = type; + this.price = price; + } +} \ No newline at end of file diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java b/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java new file mode 100644 index 0000000..06b5484 --- /dev/null +++ b/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java @@ -0,0 +1,7 @@ +package com.ilotterytea.maxoning.player; + +public enum MaxonItemEnum { + DUMMY, + BUFF, + SLAVE +} diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java b/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java new file mode 100644 index 0000000..1ac3e93 --- /dev/null +++ b/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java @@ -0,0 +1,31 @@ +package com.ilotterytea.maxoning.player; + +import com.ilotterytea.maxoning.ui.AnimatedImage; + +import java.util.HashMap; +import java.util.Map; + +public class MaxonItemRegister { + private static Map items = new HashMap<>(); + + public static void register( + int id, + String name, + String desc, + AnimatedImage icon, + MaxonItemEnum type, + float price + ) { + items.put(id, new MaxonItem(name, desc, icon, type, price)); + } + + public static void unRegister( + int id + ) { + items.remove(id); + } + + public static Map getItems() { return items; } + public static MaxonItem get(int id) { return items.get(id); } + public static boolean contains(int id) { return items.containsKey(id); } +} -- cgit v1.2.3