Inject ShopFactory

This commit is contained in:
P0nk
2023-03-29 20:51:31 +02:00
parent 705efb4340
commit c71ca7f4d5
10 changed files with 42 additions and 30 deletions

View File

@@ -26,15 +26,16 @@ package client.command.commands.gm2;
import client.Client;
import client.command.Command;
import client.command.CommandContext;
import server.ShopFactory;
public class GmShopCommand extends Command {
{
setDescription("Open the GM shop.");
}
private static final int GM_SHOP_ID = 1337;
@Override
public void execute(Client c, String[] params, CommandContext ctx) {
ShopFactory.getInstance().getShop(1337).sendShop(c);
ctx.shopFactory().getShop(GM_SHOP_ID).sendShop(c);
}
}

View File

@@ -26,7 +26,6 @@ package client.command.commands.gm3;
import client.Client;
import client.command.Command;
import client.command.CommandContext;
import server.ShopFactory;
public class ReloadShopsCommand extends Command {
@@ -36,6 +35,6 @@ public class ReloadShopsCommand extends Command {
@Override
public void execute(Client c, String[] params, CommandContext ctx) {
ShopFactory.getInstance().reloadShops();
ctx.shopFactory().reloadShops();
}
}