Rename and clean up MapleShopFactory
This commit is contained in:
@@ -25,19 +25,17 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Matze
|
||||
*/
|
||||
public class MapleShopFactory {
|
||||
|
||||
private static MapleShopFactory instance = new MapleShopFactory();
|
||||
|
||||
public static MapleShopFactory getInstance() {
|
||||
public class ShopFactory {
|
||||
private static final ShopFactory instance = new ShopFactory();
|
||||
|
||||
public static ShopFactory getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private Map<Integer, Shop> shops = new HashMap<>();
|
||||
private Map<Integer, Shop> npcShops = new HashMap<>();
|
||||
|
||||
private final Map<Integer, Shop> shops = new HashMap<>();
|
||||
private final Map<Integer, Shop> npcShops = new HashMap<>();
|
||||
|
||||
private Shop loadShop(int id, boolean isShopId) {
|
||||
Shop ret = Shop.createFromDB(id, isShopId);
|
||||
@@ -65,7 +63,7 @@ public class MapleShopFactory {
|
||||
}
|
||||
return loadShop(npcId, false);
|
||||
}
|
||||
|
||||
|
||||
public void reloadShops() {
|
||||
shops.clear();
|
||||
npcShops.clear();
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.life;
|
||||
|
||||
import client.Client;
|
||||
import server.MapleShopFactory;
|
||||
import server.ShopFactory;
|
||||
import server.maps.MapObjectType;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -35,11 +35,11 @@ public class NPC extends AbstractLoadedLife {
|
||||
}
|
||||
|
||||
public boolean hasShop() {
|
||||
return MapleShopFactory.getInstance().getShopForNPC(getId()) != null;
|
||||
return ShopFactory.getInstance().getShopForNPC(getId()) != null;
|
||||
}
|
||||
|
||||
public void sendShop(Client c) {
|
||||
MapleShopFactory.getInstance().getShopForNPC(getId()).sendShop(c);
|
||||
ShopFactory.getInstance().getShopForNPC(getId()).sendShop(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user