Examples of ScoreEvent


Examples of com.jcloisterzone.event.ScoreEvent

    public void scoreFeature(int points, ScoreContext ctx, Player p) {
        PointCategory pointCategory = ctx.getMasterFeature().getPointCategory();
        p.addPoints(points, pointCategory);
        Follower follower = ctx.getSampleFollower(p);
        boolean isFinalScoring = getPhase() instanceof GameOverPhase;
        ScoreEvent scoreEvent;
        if (fairyCapability != null && follower.at(fairyCapability.getFairyPosition())) {
            p.addPoints(FairyCapability.FAIRY_POINTS_FINISHED_OBJECT, PointCategory.FAIRY);
            scoreEvent = new ScoreEvent(follower.getFeature(), points+FairyCapability.FAIRY_POINTS_FINISHED_OBJECT, pointCategory, follower);
            scoreEvent.setLabel(points+" + "+FairyCapability.FAIRY_POINTS_FINISHED_OBJECT);
        } else {
            scoreEvent = new ScoreEvent(follower.getFeature(), points, pointCategory, follower);
        }
        scoreEvent.setFinal(isFinalScoring);
        post(scoreEvent);
    }
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

    private void scoreCastle(Castle castle, int points) {
        List<Meeple> meeples = castle.getMeeples();
        if (meeples.isEmpty()) meeples = castle.getSecondFeature().getMeeples();
        Meeple m = meeples.get(0); //all meeples must share same owner
        m.getPlayer().addPoints(points, PointCategory.CASTLE);
        game.post(new ScoreEvent(m.getFeature(), points, PointCategory.CASTLE, m));
        undeloyMeeple(m);
    }
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

    public void makeCloisterChallenged(Cloister cloister) {
        boolean first = true;
        for (Meeple m : cloister.getMeeples()) {
            if (first) {
                game.post(new ScoreEvent(cloister, 0, PointCategory.CLOISTER, m));
                first = false;
            }
            m.undeploy();
        }
    }
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

        Position fairyPos = fairyCap.getFairyPosition();
        if (fairyPos != null) {
            for (Meeple m : game.getDeployedMeeples()) {
                if (m.at(fairyPos) && m.getPlayer() == getActivePlayer()) {
                    m.getPlayer().addPoints(1, PointCategory.FAIRY);
                    game.post(new ScoreEvent(m.getPosition(), m.getPlayer(), 1, PointCategory.FAIRY));
                    break;
                }
            }
        }
        next();
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

        game.post(new GameStateChangeEvent(GameStateChangeEvent.GAME_OVER));
    }

    @Override
    public void scoreCastle(Meeple meeple, Castle castle) {
        ScoreEvent ev = new ScoreEvent(meeple.getFeature(), 0, PointCategory.CASTLE, meeple);
        ev.setFinal(true);
        game.post(ev);
    }
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

    @Override
    public void scoreBarn(FarmScoreContext ctx, Barn meeple) {
        int points = ctx.getBarnPoints();
        meeple.getPlayer().addPoints(points, PointCategory.FARM);
        ScoreEvent ev = new ScoreEvent(meeple.getFeature(), points, PointCategory.FARM, meeple);
        ev.setFinal(true);
        game.post(ev);
    }
View Full Code Here

Examples of com.jcloisterzone.event.ScoreEvent

        } else {
            rose = rose.rotateCW(roseRotation);
            if (isInProperQuadrant(rose, tile.getPosition())) {
                Player p = game.getActivePlayer();
                p.addPoints(WIND_ROSE_POINTS, PointCategory.WIND_ROSE);
                game.post(new ScoreEvent(tile.getPosition(), p, WIND_ROSE_POINTS, PointCategory.WIND_ROSE));
            }
        }
    }
View Full Code Here

Examples of com.svanloon.game.wizard.client.event.ScoreEvent

      message = handlePlayerPlayed(event);
    } else if(we instanceof PlayerWonTrickEvent) {
      PlayerWonTrickEvent event = (PlayerWonTrickEvent) we;
      message = handlePlayerWonTrick(event);
    } else if(we instanceof ScoreEvent) {
      ScoreEvent event = (ScoreEvent) we;
      message = handleScore(event);
    } else if(we instanceof PlayerNeedsToPlay) {
      PlayerNeedsToPlay event = (PlayerNeedsToPlay) we;
      message = handlePlayerNeedsToPlay(event);
    } else {
View Full Code Here

Examples of com.svanloon.game.wizard.client.event.ScoreEvent

      Card card = getCard(mps);
      listener.handlePlayerWonTrick(new PlayerWonTrickEvent(id, card));
    } else if(mt.equals(MessageType.SCORE_EVENT)) {
      int score = getInt(mps, MessageParamConstants.SCORE);
      int id = getPlayerId(mps);
      listener.handleScore(new ScoreEvent(id, score));
    } else if(mt.equals(MessageType.PLAYER_NEEDS_TO_PLAY)) {
      int id = getPlayerId(mps);
      listener.handlePlayerNeedsToPlay(new PlayerNeedsToPlay(id));
    }
  }
View Full Code Here

Examples of com.svanloon.game.wizard.client.event.ScoreEvent

        score = 20 + bidInt * 10;
      } else {
        score = -1 * Math.abs((bidInt - tricksWon) * 10);
      }

      gameEventNotifier.notify(new ScoreEvent(player.getId(), score));
      game.addScore(player.getId(), score);
      IndividualScore individualScore = new IndividualScore(player, score);
      this.overallScores.addIndividualScore(individualScore);
      i++;
    }
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.