From 5ce54d7779d7a16c00ed62df86d06c4ec5faf44a Mon Sep 17 00:00:00 2001 From: AppleDash Date: Tue, 19 Jul 2016 21:28:58 -0400 Subject: [PATCH] Clean up Economable a bit --- .../economy/economable/Economable.java | 4 ++-- .../economy/economable/EconomableGeneric.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/EconomableGeneric.java diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/Economable.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/Economable.java index bd37cc1..1ec24a1 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/Economable.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/Economable.java @@ -13,7 +13,7 @@ public interface Economable { return new EconomablePlayer(player); } - static Economable wrap(String playerName) { - return () -> "wtf:" + playerName; + static Economable wrap(String identifier) { + return new EconomableGeneric("generic:" + identifier); } } diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/EconomableGeneric.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/EconomableGeneric.java new file mode 100644 index 0000000..2a368bc --- /dev/null +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/economable/EconomableGeneric.java @@ -0,0 +1,18 @@ +package org.appledash.saneeconomy.economy.economable; + +/** + * Created by appledash on 7/19/16. + * Blackjack is still best pony. + */ +public class EconomableGeneric implements Economable { + private String uniqueIdentifier; + + public EconomableGeneric(String uniqueIdentifier) { + this.uniqueIdentifier = uniqueIdentifier; + } + + @Override + public String getUniqueIdentifier() { + return uniqueIdentifier; + } +}