Add Shop interface
This commit is contained in:
parent
1167f60bbb
commit
062d898575
44
src/main/java/com/alttd/playershops/api/Shop.java
Normal file
44
src/main/java/com/alttd/playershops/api/Shop.java
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.alttd.playershops.api;
|
||||||
|
|
||||||
|
import com.alttd.playershops.shop.ShopType;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface Shop { // TODO finish docs
|
||||||
|
|
||||||
|
String getOwnerName();
|
||||||
|
|
||||||
|
UUID getOwnerUUID();
|
||||||
|
|
||||||
|
ShopType getType();
|
||||||
|
|
||||||
|
Location getSignLocation();
|
||||||
|
|
||||||
|
Location getContainerLocation();
|
||||||
|
|
||||||
|
String getServer();
|
||||||
|
|
||||||
|
double getPrice();
|
||||||
|
|
||||||
|
void setPrice(double price);
|
||||||
|
|
||||||
|
int getAmount();
|
||||||
|
|
||||||
|
void setAmount(int amount);
|
||||||
|
|
||||||
|
double getBalance();
|
||||||
|
|
||||||
|
void setBalance(double balance);
|
||||||
|
|
||||||
|
ItemStack getItemStack();
|
||||||
|
|
||||||
|
void setItemStack(ItemStack itemStack);
|
||||||
|
|
||||||
|
ItemStack getSecondaryItem();
|
||||||
|
|
||||||
|
void setSecondaryItem(ItemStack itemStack);
|
||||||
|
|
||||||
|
boolean isInitialized();
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.alttd.playershops.shop;
|
package com.alttd.playershops.shop;
|
||||||
|
|
||||||
|
import com.alttd.playershops.api.Shop;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
@ -10,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public abstract class AbstractShop {
|
public abstract class AbstractShop implements Shop {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private int id;
|
private int id;
|
||||||
|
|
@ -38,6 +39,8 @@ public abstract class AbstractShop {
|
||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
private long lastTransaction;
|
private long lastTransaction;
|
||||||
|
|
||||||
|
protected boolean initialized;
|
||||||
|
|
||||||
AbstractShop(Location signLocation, UUID uuid, double price, int amount) {
|
AbstractShop(Location signLocation, UUID uuid, double price, int amount) {
|
||||||
this.signLocation = signLocation;
|
this.signLocation = signLocation;
|
||||||
if (signLocation != null) {
|
if (signLocation != null) {
|
||||||
|
|
@ -67,4 +70,8 @@ public abstract class AbstractShop {
|
||||||
}
|
}
|
||||||
return ChatColor.RED + "[CLOSED]";
|
return ChatColor.RED + "[CLOSED]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInitialized() {
|
||||||
|
return initialized;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user