Package games.stendhal.server.entity.item

Examples of games.stendhal.server.entity.item.StackableItem


    PlayerTestHelper.registerPlayer(george);
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
    Integer number = Integer.valueOf(1);
    Offer offer = market.createOffer(george, item, price, number);
    assertThat(offer.getItem(), is(item));
    assertThat(offer.getPrice(), is(price));
View Full Code Here


    item = SingletonRepository.getEntityManager().getItem("carrot");
    george.equipToInventoryOnly(item);
    Offer offer2 = market.createOffer(george, item, 11, 1);
   
    Player ernie = PlayerTestHelper.createPlayer("ernie");
    StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
    money.setQuantity(21);
    ernie.equipToInventoryOnly(money);
    market.acceptOffer(offer, ernie);
    market.acceptOffer(offer2, ernie);
   
    assertThat(market.hasEarningsFor(george), is(Boolean.TRUE));
View Full Code Here

  public void testNonExistingOffer() {
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    Player george = PlayerTestHelper.createPlayer("george");
    Offer offer = new Offer(item, price, george);
    offer.setID(new ID(1, "shop"));

    Player ernie = PlayerTestHelper.createPlayer("ernie");
View Full Code Here

    Player bob = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    Integer tooFewMoney = price - 1;
    erniesMoney.setQuantity(tooFewMoney);
    bob.equipToInventoryOnly(item);
    Offer offer = market.createOffer(bob, item, price, Integer.valueOf(1));

    Player ernie = PlayerTestHelper.createPlayer("ernie");
    ernie.equipToInventoryOnly(erniesMoney);
View Full Code Here

    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("greater potion");
    ((StackableItem) item).setQuantity(6);
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
    Integer number = Integer.valueOf(5);
    Offer offer = market.createOffer(george, item, price, number);
    assertThat(offer.getItem().getName(), is("greater potion"));
    assertThat(((StackableItem) offer.getItem()).getQuantity(), is(5));
View Full Code Here

  public void testCheatWithStacks() {
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Player george = PlayerTestHelper.createPlayer("george");
    StackableItem item = (StackableItem) SingletonRepository.getEntityManager().getItem("meat");
    // ensure the item gets an id
    george.equipToInventoryOnly(item);
    george.drop(item);
   
    Offer offer = market.createOffer(george, item, 42, 1);
View Full Code Here

    item = SingletonRepository.getEntityManager().getItem("carrot");
    george.equipToInventoryOnly(item);
    Offer offer2 = market.createOffer(george, item, 11, 1);
   
    Player ernie = PlayerTestHelper.createPlayer("ernie");
    StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
    money.setQuantity(21);
    ernie.equipToInventoryOnly(money);
   
    assertThat(market.getEarningsOlderThan(0).size(), is(0));
    market.acceptOffer(offer, ernie);
    assertThat(market.getEarningsOlderThan(-10).size(), is(1));
View Full Code Here

    PlayerTestHelper.registerPlayer(george);
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
    Integer number = Integer.valueOf(1);
    Offer offer = market.createOffer(george, item, price, number);
    assertThat(offer.getItem(), is(item));
    assertThat(offer.getPrice(), is(price));
View Full Code Here

    PlayerTestHelper.registerPlayer(george);
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
   
    // ensure different CIDs
    CIDSubmitAction.nameList.put("george", "georgescid");
    CIDSubmitAction.nameList.put("ernie", "erniescid");
View Full Code Here

    PlayerTestHelper.registerPlayer(george);
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
   
    CIDSubmitAction.nameList.put("ernie", "erniescid");
   
    Offer offer = market.createOffer(george, item, price, 1);
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.item.StackableItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.