Examples of Game


Examples of client.views.swing.gameboard.Game

    public GameView MainView = null;
    private Play play = null; // Model in MVC Architecture

    public GameController(Play play) {
        this.play = play;
        MainView = new Game(this);
        addListenersToModel();
    }
View Full Code Here

Examples of clueless.model.Game

    if(isServer){
      server = new CluelessServer(this, port, numPlayers);
      server.start();

      //Create and register Game model
      game = new Game(this);

      /** Display connection status window &
       *  Start Pre-Game actions when all players are connected
       */
      //this.setNumberOfPlayers(numPlayers);
 
View Full Code Here

Examples of com.acme.jpa.model.Game

      // insert records
      System.out.println("Inserting records...");
      for (String title : GAME_TITLES)
      {
         Game game = new Game(title);
         games.add(game);
      }

      List<Game> results;
View Full Code Here

Examples of com.jcloisterzone.game.Game

     */
    @Override
    public void paintComponent(Graphics2D parentGraphics) {
        super.paintComponent(parentGraphics);

        Game game = client.getGame();

        //TODO better display
//        if (player.getSlot().getState() == SlotState.CLOSED) {
//            this.color = Color.GRAY;
//        }

//    GridPanel gp = client.getGridPanel();

//        boolean isActive = game.getActivePlayer() == player;
//        boolean playerTurn = game.getTurnPlayer() == player;

//    gp.profile(" > get flags");

        BufferedImage bimg = UiUtils.newTransparentImage(PANEL_WIDTH, 200);
        g2 = bimg.createGraphics();
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

//    gp.profile(" > create buffer");

        drawDelimiter(DELIMITER_Y);

        g2.setFont(FONT_POINTS);
        drawTextShadow(""+player.getPoints(), PADDING_L, 27);

        g2.setFont(FONT_NICKNAME);
        drawTextShadow(player.getNick(), 78, 27);

//    gp.profile(" > nick & score");

        g2.setFont(FONT_MEEPLE);
        bx = PADDING_L;
        by = 43;

        int small = 0;
        String smallImgKey = SmallFollower.class.getSimpleName();
        for (Follower f : Iterables.filter(player.getFollowers(), MeeplePredicates.inSupply())) {
            //instanceof cannot be used because of Phantom
            if (f.getClass().equals(SmallFollower.class)) {
                small++;
            } else { //all small followers are at beginning of collection
                drawMeepleBox(player, smallImgKey, small, true);
                small = 0;
                drawMeepleBox(player, f.getClass().getSimpleName(), 1, false);
            }
        }
        drawMeepleBox(player, smallImgKey, small, true); //case when only small followers are in collection (not drawn yet)

//    gp.profile(" > followers");

        for (Special meeple : Iterables.filter(player.getSpecialMeeples(), MeeplePredicates.inSupply())) {
            drawMeepleBox(player, meeple.getClass().getSimpleName(), 1, false);
        }

//    gp.profile(" > special");

        AbbeyCapability abbeyCap = game.getCapability(AbbeyCapability.class);
        TowerCapability towerCap = game.getCapability(TowerCapability.class);
        BridgeCapability bridgeCap = game.getCapability(BridgeCapability.class);
        CastleCapability castleCap = game.getCapability(CastleCapability.class);
        KingAndRobberBaronCapability kingRobberCap = game.getCapability(KingAndRobberBaronCapability.class);
        ClothWineGrainCapability cwgCap = game.getCapability(ClothWineGrainCapability.class);
        LittleBuildingsCapability lbCap = game.getCapability(LittleBuildingsCapability.class);

        if (abbeyCap != null) {
            drawMeepleBox(null, "abbey", abbeyCap.hasUnusedAbbey(player) ? 1 : 0, false);
        }

        if (towerCap != null) {
            drawMeepleBox(null, "towerpiece", towerCap.getTowerPieces(player), true);
            getMouseRegions().clear();
        }

        if (bridgeCap != null) {
            drawMeepleBox(null, "bridge", bridgeCap.getPlayerBridges(player), true);
        }
        if (castleCap != null) {
            drawMeepleBox(null, "castle", castleCap.getPlayerCastles(player), true);
        }
        if (lbCap != null) {
            drawMeepleBox(null, "lb-tower", lbCap.getBuildingsCount(player, LittleBuilding.TOWER), true);
            drawMeepleBox(null, "lb-house", lbCap.getBuildingsCount(player, LittleBuilding.HOUSE), true);
            drawMeepleBox(null, "lb-shed", lbCap.getBuildingsCount(player, LittleBuilding.SHED), true);
        }

        if (kingRobberCap != null) {
            if (kingRobberCap.getKing() == player) {
                Rectangle r = drawMeepleBox(null, "king", 1, false, "king");
                if ("king".equals(mouseOverKey)) {
                    g2.setFont(FONT_KING_ROBBER_OVERLAY);
                    g2.setColor(KING_ROBBER_OVERLAY);
                    g2.fillRect(r.x, r.y, r.width, r.height);
                    g2.setColor(Color.WHITE);
                    int size = kingRobberCap.getBiggestCitySize();
                    g2.drawString((size < 10 ? " " : "") + size, r.x+2, r.y+20);
                    g2.setFont(FONT_MEEPLE);
                }
            }
            if (kingRobberCap.getRobberBaron() == player) {
                Rectangle r = drawMeepleBox(null, "robber", 1, false, "robber");
                if ("robber".equals(mouseOverKey)) {
                    g2.setFont(FONT_KING_ROBBER_OVERLAY);
                    g2.setColor(KING_ROBBER_OVERLAY);
                    g2.fillRect(r.x, r.y, r.width, r.height);
                    g2.setColor(Color.WHITE);
                    int size = kingRobberCap.getLongestRoadLength();
                    g2.drawString((size < 10 ? " " : "") + size, r.x+2, r.y+20);
                    g2.setFont(FONT_MEEPLE);
                }
            }
        }
        if (cwgCap != null) {
            drawMeepleBox(null, "cloth", cwgCap.getTradeResources(player, TradeResource.CLOTH), true);
            drawMeepleBox(null, "grain", cwgCap.getTradeResources(player, TradeResource.GRAIN), true);
            drawMeepleBox(null, "wine", cwgCap.getTradeResources(player, TradeResource.WINE), true);
        }
        if (towerCap != null) {
            List<Follower> capturedFigures = towerCap.getPrisoners().get(player);
            Map<Class<? extends Follower>, Integer> groupedByType;
            if (!capturedFigures.isEmpty()) {
                groupedByType = new HashMap<>();
                for (Player opponent : game.getAllPlayers()) {
                    if (opponent == player) continue;
                    boolean isOpponentActive = opponent.equals(game.getActivePlayer()) && opponent.isLocalHuman();
                    boolean clickable = isOpponentActive && !towerCap.isRansomPaidThisTurn();
                    for (Follower f : capturedFigures) {
                        if (f.getPlayer() == opponent) {
                            Integer prevVal = groupedByType.get(f.getClass());
                            groupedByType.put(f.getClass(), prevVal == null ? 1 : prevVal+1);
View Full Code Here

Examples of com.lunivore.gameoflife.domain.Game

    private StringRenderer renderer;

    @Given("a $width by $height game")
    @Aliases(values={"a new game: $width by $height"})
    public void theGameIsRunning(int width, int height) {
        game = new Game(width, height);
        renderer = new StringRenderer();
        game.setObserver(renderer);
    }
View Full Code Here

Examples of com.music.web.websocket.Game

        GameEvent response = mapper.readValue(messages.get("1").removeLast().getPayload().toString(), GameEvent.class);
        Assert.assertEquals(GameEventType.GAME_INITIALIZED, response.getType());

        Assert.assertEquals(1, handler.getGames().size());

        Game game = handler.getGames().values().iterator().next();
        Assert.assertEquals(game.getId(), response.getGameId());
    }
View Full Code Here

Examples of com.nebhale.letsmakeadeal.Game

    private final Object monitor = new Object();

    public Game create() {
        synchronized (this.monitor) {
            Long id = this.idGenerator.getAndIncrement();
            Game game = new Game(id, createDoors());

            this.games.put(id, game);

            return game;
        }
View Full Code Here

Examples of com.sirenian.hellbound.engine.Game

        this.guiQueue = guiQueue;
        this.heartbeat = heartbeat;
        Logger.debug(this, "Creating Hellbound instance...");

        frame = createFrameForGui(engineQueue, pitPanel);
        Game game = createEngineForGame(heartbeat, factory);
       
        connectQueues(game, pitPanel);
        bindThreadsToFrame();
        startHellbound();
    }
View Full Code Here

Examples of com.zeroqualitygames.spaceinvaders.Game

  private static final long serialVersionUID = 1L;
  private Game game;

  public GameMain(String name) {
    super(name);
    game = new Game();
   
    setSize(Game.WIDTH + JFrame.WIDTH , Game.HEIGHT + JFrame.HEIGHT);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setIgnoreRepaint(true);
   
View Full Code Here

Examples of de.ailis.xadrian.data.Game

     */
    public static void main(final String[] args) throws Exception
    {
        SwingUtils.prepareGUI();

        Game game = GameFactory.getInstance().getGame("x3tc");
        final SectorSelector component = new SectorSelector(game);
        SwingUtils.testComponent(component);
    }
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.