diff options
| author | ilotterytea <iltsu@alright.party> | 2022-08-31 03:15:11 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-08-31 03:15:11 +0600 |
| commit | 75d3d9c340d5589b23fa746118050150726636c7 (patch) | |
| tree | 12096992dfd343298fd0491872c8dc78ca25700a /core | |
| parent | e53abdfe8ccd11f8589ac4b6aef5ae916cd65901 (diff) | |
Items
Diffstat (limited to 'core')
3 files changed, 57 insertions, 0 deletions
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<Integer, MaxonItem> 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<Integer, MaxonItem> getItems() { return items; } + public static MaxonItem get(int id) { return items.get(id); } + public static boolean contains(int id) { return items.containsKey(id); } +} |
