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

@@ -28,12 +28,6 @@ import java.util.Map;
* @author Matze
*/
public class ShopFactory {
private static final ShopFactory instance = new ShopFactory();
public static ShopFactory getInstance() {
return instance;
}
private final Map<Integer, Shop> shops = new HashMap<>();
private final Map<Integer, Shop> npcShops = new HashMap<>();

View File

@@ -22,7 +22,6 @@
package server.life;
import client.Client;
import server.ShopFactory;
import server.maps.MapObjectType;
import tools.PacketCreator;
@@ -34,14 +33,6 @@ public class NPC extends AbstractLoadedLife {
this.stats = stats;
}
public boolean hasShop() {
return ShopFactory.getInstance().getShopForNPC(getId()) != null;
}
public void sendShop(Client c) {
ShopFactory.getInstance().getShopForNPC(getId()).sendShop(c);
}
@Override
public void sendSpawnData(Client client) {
client.sendPacket(PacketCreator.spawnNPC(this));