Examples of Expansion


Examples of com.jcloisterzone.Expansion

    @WsSubscribe
    public void handleSetExpansion(WebSocket ws, SetExpansionMessage msg) {
        if (!msg.getGameId().equals(game.getGameId())) throw new IllegalArgumentException("Invalid game id.");
        if (gameStarted) throw new IllegalArgumentException("Game is already started.");
        Expansion expansion = msg.getExpansion();
        if (!expansion.isImplemented() || expansion == Expansion.BASIC) {
            logger.error("Invalid expansion {}", expansion);
            return;
        }
        if (msg.isEnabled()) {
            game.getExpansions().add(msg.getExpansion());
View Full Code Here

Examples of com.jcloisterzone.Expansion

        Element expansion = (Element) nl.item(0);
        nl = expansion.getElementsByTagName("expansion");
        if (nl.getLength() == 0) throw new Exception("No expansion is supported by " + getId());
        for (int i = 0; i < nl.getLength(); i++) {
            String expName = nl.item(i).getFirstChild().getNodeValue().trim();
            Expansion exp = Expansion.valueOf(expName);
            supportedExpansions.add(exp.getCode());
        }
    }
View Full Code Here

Examples of com.jcloisterzone.Expansion

    }


    @WsSubscribe
    public void handleSetExpansion(SetExpansionMessage msg) {
        Expansion expansion = msg.getExpansion();
        if (msg.isEnabled()) {
            game.getExpansions().add(expansion);
        } else {
            game.getExpansions().remove(expansion);
        }
View Full Code Here

Examples of com.jcloisterzone.Expansion

        DefaultTilePack tilePack = new DefaultTilePack();

        Map<String, Integer> discardList = getDiscardTiles();

        for (Entry<Expansion, Element> entry: defs.entrySet()) {
            Expansion expansion = entry.getKey();
            NodeList nl = entry.getValue().getElementsByTagName("tile");
            for (int i = 0; i < nl.getLength(); i++) {
                Element tileElement = (Element) nl.item(i);
                String tileId = getTileId(expansion, tileElement);
                LinkedList<Position> positions = getPreplacedPositions(tileId, tileElement);
View Full Code Here

Examples of com.jcloisterzone.Expansion

    public Set<Expansion> getExpansions() {
        Set<Expansion> result = new HashSet<>();
        NodeList nl = root.getElementsByTagName("expansion");
        for (int i = 0; i < nl.getLength(); i++) {
            Element el = (Element) nl.item(i);
            Expansion exp = Expansion.valueOf(el.getAttribute("name"));
            result.add(exp);
        }
        return result;
    }
View Full Code Here

Examples of com.jcloisterzone.Expansion

        rulesPanel.setBorder(new TitledBorder(null, _("Rules"),
                TitledBorder.LEADING, TitledBorder.TOP, null, null));
        rulesPanel.setLayout(new MigLayout("", "[]", "[]"));
        add(rulesPanel, "cell 2 1,grow");

        Expansion prev = Expansion.BASIC;
        for (CustomRule rule : CustomRule.values()) {
            if (rule == CustomRule.RANDOM_SEATING_ORDER) continue;
            if (prev != rule.getExpansion()) {
                prev = rule.getExpansion();
                JLabel label = new JLabel(prev.toString());
                label.setFont(FONT_RULE_SECTION);
                rulesPanel.add(label, "wrap, growx, gaptop 10, gapbottom 7");
            }
            JCheckBox chbox = createRuleCheckbox(rule, mutableSlots);
            rulesPanel.add(chbox, "wrap");
View Full Code Here

Examples of eu.ha3.matmos.expansions.Expansion

    for (int expansionIndex = this.pageFromZero * this.IDS_PER_PAGE; expansionIndex < this.pageFromZero
      * this.IDS_PER_PAGE + this.IDS_PER_PAGE
      && expansionIndex < sortedNames.size(); expansionIndex++)
    {
      final String uniqueIdentifier = sortedNames.get(expansionIndex);
      final Expansion expansion = expansions.get(uniqueIdentifier);
      this.expansionList.add(expansion);
     
      HGuiSliderControl sliderControl =
        new HGuiSliderControl(
          id, _LEFT + _MIX, _MIX * (id + 1), _ELEMENT_WIDTH - _MIX * 2, _UNIT, "",
          expansion.getVolume() * 0.5f);
      sliderControl.setListener(new HSliderListener() {
        @Override
        public void sliderValueChanged(HGuiSliderControl slider, float value)
        {
          expansion.setVolumeAndUpdate(value * 2);
          if (value > 0f && !expansion.isActivated())
          {
            expansion.activate();
          }
          slider.updateDisplayString();
        }
       
        @Override
        public void sliderPressed(HGuiSliderControl hGuiSliderControl)
        {
        }
       
        @Override
        public void sliderReleased(HGuiSliderControl hGuiSliderControl)
        {
          if (MAtGuiMenu.this.isAutopreviewEnabled())
          {
            expansion.playSample();
          }
        }
      });
     
      sliderControl.setDisplayStringProvider(new HDisplayStringProvider() {
        @Override
        public String provideDisplayString()
        {
          String display = expansion.getFriendlyName() + ": ";
          if (expansion.getVolume() == 0f)
          {
            if (expansion.isActivated())
            {
              display = display + "Will be disabled";
            }
            else
            {
              display = display + "Disabled";
            }
          }
          else
          {
            display = display + (int) Math.floor(expansion.getVolume() * 100) + "%";
          }
         
          return ChatColorsSimple.THEN_ITALIC + display;
        }
      });
      sliderControl.updateDisplayString();
     
      this.buttonList.add(sliderControl);
     
      if (!this.mod.isDebugMode())
      {
        this.buttonList.add(new GuiButton(Make.make(new ActionPerformed() {
          @Override
          public void actionPerformed()
          {
            if (expansion.isActivated())
            {
              expansion.playSample();
            }
          }
        }), _RIGHT - _UNIT, _MIX * (id + 1), _UNIT, _UNIT, "?"));
       
        if (expansion.hasMoreInfo())
        {
          this.buttonList.add(new GuiButton(Make.make(new ActionPerformed() {
            @Override
            public void actionPerformed()
            {
View Full Code Here

Examples of purrpackagedemo.Transformation.Expansion

   
    Rotation r = new Rotation( Math.PI / 2.0 );
    assertPointEquals( new Point( 0, 1 ), r.apply( new Point( 1, 0 )) );
    assertPointEquals( new Point( -2, 0 ), r.apply( r.apply( new Point( 2, 0 ))) );
   
    Expansion z = new Expansion( -2 );
    assertPointEquals( new Point( 14, -16 ), z.apply( new Point( -7, 8 )) );
  }
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.