Exemple #1
0
  private void createShops() {
    Shop s = new Shop("Spawn Shop", new Location(1580, 1500));
    addUnitToShop(s, Guardsman.DEFAULT_INSTANCE);
    addUnitToShop(s, Knight.DEFAULT_INSTANCE);
    addUnitToShop(s, DarkKnight.DEFAULT_INSTANCE);
    addUnitToShop(s, Archer.DEFAULT_INSTANCE);
    addUnitToShop(s, LongBowman.DEFAULT_INSTANCE);
    s.getItems()
        .add(
            new Possession<ItemType>(
                CrownOfLeader.DEFAULT_INSTANCE, CrownOfLeader.DEFAULT_INSTANCE.getDefaultValue()));
    s.getItems()
        .add(
            new Possession<ItemType>(
                SmallSword.DEFAULT_INSTANCE, SmallSword.DEFAULT_INSTANCE.getDefaultValue()));
    s.getItems()
        .add(
            new Possession<ItemType>(
                SmallBow.DEFAULT_INSTANCE, SmallBow.DEFAULT_INSTANCE.getDefaultValue()));
    s.getItems()
        .add(
            new Possession<ItemType>(
                SmallShield.DEFAULT_INSTANCE, SmallShield.DEFAULT_INSTANCE.getDefaultValue()));

    s.getItems()
        .add(
            new Possession<ItemType>(
                Scythe.DEFAULT_INSTANCE, Scythe.DEFAULT_INSTANCE.getDefaultValue()));
    s.getItems()
        .add(
            new Possession<ItemType>(
                BigShield.DEFAULT_INSTANCE, BigShield.DEFAULT_INSTANCE.getDefaultValue()));
    s.getItems()
        .add(
            new Possession<ItemType>(
                VikingHelmet.DEFAULT_INSTANCE, VikingHelmet.DEFAULT_INSTANCE.getDefaultValue()));
    shops.put(s.getId(), s);

    s = new Shop("Balmora Shop", new Location(1400, 1550));
    s.getItems()
        .add(
            new Possession<ItemType>(
                PotionOfLife.DEFAULT_INSTANCE, PotionOfLife.DEFAULT_INSTANCE.getDefaultValue()));
    shops.put(s.getId(), s);

    LoginInfo.loadShops(shops.values());
  }
Exemple #2
0
 private void addUnitToShop(Shop s, UnitType t) {
   s.getUnits().add(new Possession<UnitType>(t, t.getHireCost()));
 }