Examples of Market


Examples of games.stendhal.server.entity.trade.Market

     
      return false;
    }
   
    private boolean prolongOffer(Player player, Offer o) {
      Market market = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
      if (market != null) {
        if (market.prolongOffer(o) != null) {
          String messageNumberOfOffers = "You now have put "+Integer.valueOf(market.countOffersOfPlayer(player)).toString()+" offers.";
          player.sendPrivateText(messageNumberOfOffers);
         
          return true;
        }
      }
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

   
    boolean onlyMyOffers = checkForMineFilter(sentence);
    boolean onlyMyExpiredOffers = checkForMyExpiredFilter(sentence);
    boolean filterForMine = false;
   
    Market market = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
   
    // Figure out what to look for
    RPSlot offersSlot = market.getSlot(Market.OFFERS_SLOT_NAME);
    if (onlyMyExpiredOffers) {
      offersSlot = market.getSlot(Market.EXPIRED_OFFERS_SLOT_NAME);
      filterForMine = true;
    }
    if (onlyMyOffers) {
      filterForMine = true;
    }
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

* @author madmetzger
*/
public class PlayerHasEarningsToCollectCondition implements ChatCondition {
 
  public boolean fire(Player player, Sentence sentence, Entity npc) {
    Market market = TradeCenterZoneConfigurator.getShopFromZone(npc.getZone());
    if(market != null) {
      return market.hasEarningsFor(player);
    }
    return false;
  }
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

  /**
   * show a list of all items for which offers exist.
   */
  public void fire(Player player, Sentence sentence, EventRaiser npc) {
    Market market = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
    RPSlot offersSlot = market.getSlot(Market.OFFERS_SLOT_NAME);
    List<Offer> offers = getOffers(offersSlot);
    if (offers.isEmpty()) {
      npc.say("Sorry, there are currently no offers.");
    } else {
      String text = buildItemListText(buildItemList(offers));
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

     * @param price price for the item
     * @param number number of items to sell
     * @return true if making the offer was successful, false otherwise
     */
    private boolean createOffer(Player player, Item item, int price, int number) {
      Market shop = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
      if(shop != null) {
        Offer o = shop.createOffer(player, item, Integer.valueOf(price), Integer.valueOf(number));
        if (o == null) {
          return false;
        }

        StringBuilder message = new StringBuilder("Offer for some ");
        message.append(item.getName());
        message.append(" at ");
        message.append(price);
        message.append(" created. ");
        String messageNumberOfOffers = "You have now made "
          + Grammar.quantityplnoun(Integer.valueOf(shop.countOffersOfPlayer(player)), "offer", "one") + ".";
        player.sendPrivateText(message.toString() + messageNumberOfOffers);
        return true;
      }
      return false;
    }
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

  }

  class ConfirmAcceptOfferChatAction implements ChatAction {
    public void fire (Player player, Sentence sentence, EventRaiser npc) {
      Offer offer = getOffer();
      Market m = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
      String itemname = offer.getItemName();
      if (m.acceptOffer(offer,player)) {
        // Successful trade. Tell the offerer
        StringBuilder earningToFetchMessage = new StringBuilder();
        earningToFetchMessage.append("Your ");
        earningToFetchMessage.append(itemname);
        earningToFetchMessage.append(" was sold. You can now fetch your earnings from me.");

        logger.debug("sending a notice to '" + offer.getOfferer() + "': " + earningToFetchMessage.toString());
        DBCommandQueue.get().enqueue(new StoreMessageCommand("Harold", offer.getOfferer(), earningToFetchMessage.toString(), "N"));

        npc.say("Thanks.");
        // Obsolete the offers, since the list has changed
        ((MarketManagerNPC) npc.getEntity()).getOfferMap().clear();
      } else {
        // Trade failed for some reason. Check why, and inform the player
        if (!m.contains(offer)) {
          int quantity = getQuantity(offer.getItem());
          npc.say("I'm sorry, but " + Grammar.thatthose(quantity) + " "
              + Grammar.quantityplnoun(quantity, offer.getItem().getName(), "the")
              + " " + Grammar.isare(quantity)
              + " no longer for sale.");
View Full Code Here

Examples of games.stendhal.server.entity.trade.Market

    }
  }
 
  private void removeOffer(Player player, EventRaiser npc) {
    Offer offer = getOffer();
    Market m = TradeCenterZoneConfigurator.getShopFromZone(player.getZone());
    m.removeOffer(offer,player);
    npc.say("Ok.");
  }
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.Market

            final RequestData requestData = requestUtil.getRequestData(request);
           
            modelAndView.getModelMap().put(ModelConstants.COMMON_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanCommon(requestData));
           
            final MarketPlace currentMarketPlace = requestData.getMarketPlace();
            final Market currentMarket = requestData.getMarket();
            final MarketArea currentMarketArea = requestData.getMarketArea();
            final Localization currentLocalization = requestData.getMarketAreaLocalization();
            final Customer customer = requestData.getCustomer();
            if(customer != null){
                modelAndView.getModelMap().put(ModelConstants.CUSTOMER_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanCustomer(requestData, customer));
            }
           
            modelAndView.getModelMap().put(ModelConstants.LEGAl_TERMS_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanLegalTerms(requestData));
           
            modelAndView.getModelMap().put(ModelConstants.HEADER_CART, frontofficeViewBeanFactory.buildViewBeanHeaderCart(requestData));
           
            // ALL MARKETPLACES
            modelAndView.getModelMap().put(ModelConstants.MARKET_PLACES_VIEW_BEAN, frontofficeViewBeanFactory.buildListViewBeanMarketPlace(requestData));
           
            // MARKETS FOR THE CURRENT MARKETPLACE
            Set<Market> marketList = currentMarketPlace.getMarkets();
            modelAndView.getModelMap().put(ModelConstants.MARKETS_VIEW_BEAN, frontofficeViewBeanFactory.buildListViewBeanMarket(requestData, currentMarketPlace, new ArrayList<Market>(marketList)));

            // MARKET AREAS FOR THE CURRENT MARKET
            Set<MarketArea> marketAreaList = currentMarket.getMarketAreas();
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREAS_VIEW_BEAN, frontofficeViewBeanFactory.buildListViewBeanMarketArea(requestData, currentMarket, new ArrayList<MarketArea>(marketAreaList)));

            // CURRENT MARKET AREA
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREA_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanMarketArea(requestData, currentMarketArea));
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.Market

        return buildDefaultPrefix(requestData) + FoUrls.CHANGE_LANGUAGE.getUrlWithoutWildcard() + "?" + RequestConstants.REQUEST_PARAMETER_LOCALE_CODE + "=" + handleParamValue(localization.getCode());
    }

    public String buildChangeLanguageUrl(final RequestData requestData) throws Exception {
        final MarketPlace marketPlace = requestData.getMarketPlace();
        final Market market = requestData.getMarket();
        final MarketArea marketArea = requestData.getMarketArea();
        final Localization localization = requestData.getMarketAreaLocalization();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final CurrencyReferential currency = requestData.getMarketAreaCurrency();

        String url = buildDefaultPrefix(requestData) + FoUrls.CHANGE_LANGUAGE.getUrlWithoutWildcard() + "?";
        url = url + RequestConstants.REQUEST_PARAMETER_MARKET_PLACE_CODE + "=" + handleParamValue(marketPlace.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_CODE + "=" + handleParamValue(market.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_CODE + "=" + handleParamValue(marketArea.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_LANGUAGE + "=" + handleParamValue(localization.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_RETAILER_CODE + "=" + handleParamValue(retailer.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_CURRENCY_CODE + "=" + handleParamValue(currency.getCode());
        return url;
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.Market

        return url;
    }

    public String buildChangeContextUrl(final RequestData requestData) throws Exception {
        final MarketPlace marketPlace = requestData.getMarketPlace();
        final Market market = requestData.getMarket();
        final MarketArea marketArea = requestData.getMarketArea();
        final Localization localization = requestData.getMarketAreaLocalization();
        final Retailer retailer = requestData.getMarketAreaRetailer();
        final CurrencyReferential currency = requestData.getMarketAreaCurrency();
       
        String url = buildDefaultPrefix(requestData) + FoUrls.CHANGE_CONTEXT.getUrlWithoutWildcard() + "?";
        url = url + RequestConstants.REQUEST_PARAMETER_MARKET_PLACE_CODE + "=" + handleParamValue(marketPlace.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_CODE + "=" + handleParamValue(market.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_CODE + "=" + handleParamValue(marketArea.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_LANGUAGE + "=" + handleParamValue(localization.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_RETAILER_CODE + "=" + handleParamValue(retailer.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_CURRENCY_CODE + "=" + handleParamValue(currency.getCode());
        return url;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.