Inject ShopFactory
This commit is contained in:
@@ -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<>();
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user