Example #1
0
 public CashShop(int accountId, int characterId, int jobType) throws SQLException {
   this.accountId = accountId;
   this.characterId = characterId;
   for (Pair<Item, MapleInventoryType> item : factory.loadItems(false, accountId).values()) {
     inventory.add(item.getLeft());
   }
 }
Example #2
0
  public void save() throws SQLException {
    List<Pair<Item, MapleInventoryType>> itemsWithType = new ArrayList<>();

    for (Item item : inventory) {
      itemsWithType.add(new Pair<>(item, GameConstants.getInventoryType(item.getItemId())));
    }

    factory.saveItems(itemsWithType, accountId);
  }