use of eidolons.game.module.adventure.town.Shop in project Eidolons by IDemiurge.
the class ShopListsPanel method initListMap.
// to be used
public Map<String, HC_PagedListPanel> initListMap(String tabName) {
if (!Launcher.getMainManager().isMacroMode()) {
return super.initListMap(tabName);
}
if (getTown() == null) {
return new HashMap<>();
}
Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
List<ObjType> items = new ArrayList<>();
Shop shop = getShop(tabName);
shop.setVendorPanel(this);
for (ObjType t : shop.getItems()) {
items.add(t);
}
for (String group : getListGroup(tabName)) {
List<ObjType> data = new ArrayList<>();
for (ObjType t : items) {
if (checkType(t, group, shop)) {
data.add(t);
}
}
if (!data.isEmpty()) {
putList(group, data, map);
}
}
// sorting?
return map;
}
use of eidolons.game.module.adventure.town.Shop in project Eidolons by IDemiurge.
the class HeroManager method checkShop.
private void checkShop(Entity type, OBJ_TYPE TYPE, PROPERTY PROP, int cost, boolean sold) {
if (C_OBJ_TYPE.ITEMS.equals(TYPE)) {
if (PROP == PROPS.INVENTORY) {
if (Launcher.getMainManager().isMacroMode()) {
String shopName = ((HeroItemView) CharacterCreator.getHeroPanel().getMvp().getCurrentViewComp()).getVendorPanel().getSelectedTabName();
Shop shop = MacroGame.getGame().getPlayerParty().getTown().getShop(shopName);
if (sold) {
shop.sellItem((ObjType) type, cost);
} else {
shop.buyItem((ObjType) type, cost);
}
}
}
}
}
Aggregations