Search in sources :

Example 1 with Shop

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;
}
Also used : Shop(eidolons.game.module.adventure.town.Shop) ObjType(main.entity.type.ObjType) XLinkedMap(main.data.XLinkedMap) HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 2 with Shop

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);
                }
            }
        }
    }
}
Also used : Shop(eidolons.game.module.adventure.town.Shop)

Aggregations

Shop (eidolons.game.module.adventure.town.Shop)2 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 XLinkedMap (main.data.XLinkedMap)1 ObjType (main.entity.type.ObjType)1