Examples of UnoGame


Examples of cero.games.uno.UnoGame

  /**
   * Create the game, the players, and initialise all the settings.
   */
  private void createGame() {
    PluginManager pmanager = PluginManager.getInstance();
    UnoGame game = (UnoGame) pmanager.getNewGame("Cero official uno");
    for (Rule r : pmanager.getGameRules(game.getGameName()))
      game.getRules().add(r);

    // 1 joueur humain suffira
    UnoPlayer p = (UnoPlayer) pmanager.getNewPlayer(game.getGameName());
    game.getPlayers().add(p);

    // 3 AI de chaque
    for (int i = 0; i < 3; i++)
      game.getPlayers().add(pmanager.getNewAI(game.getGameName(), "Standard AI"));
    game.getPlayers().get(0).setPlayerName("Toi");
    game.getPlayers().get(1).setPlayerName("Bob");
    game.getPlayers().get(2).setPlayerName("Léa");
    game.getPlayers().get(3).setPlayerName("Max");
    player = (UnoPlayer) game.getPlayers().get(0);

    for (GameInitializer init : pmanager.getGameInitializers(game
        .getGameName()))
      game.getGameInitializers().add(init);

    this.game = game;
  }
View Full Code Here

Examples of cero.games.uno.UnoGame

  /**
   * Retrieves all the needed information and print them into the box.
   */
  private void printInfos() {
    UnoGame game = ((Frame) parent).getGame();
    UnoPlayer player = ((Frame) parent).getPlayer();
    List<cero.games.Player> listPlayers = game.getPlayers().getSortedList();
    title = new JLabel("", JLabel.CENTER);

    for (cero.games.Player players : listPlayers) {
      if (players.equals(player)) {
        ZonesGroup zones = players.getZones();
        int totalNumberOfCards = 0;
        for (Zone zone : zones)
          totalNumberOfCards += zone.getCardCount();

        if (totalNumberOfCards == 0) {
          title.setText("Tu as gagné");
          SoundManager.playSound(new WaveSound("wav/gui/win.wav",
              false));
        } else {
          title.setText("Tu as perdu");
          SoundManager.playSound(new WaveSound("wav/gui/loose.wav",
              false));
        }
      }
    }
    title.setFont(font);
    title.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    labelPanel.add(title, BorderLayout.NORTH);

    SoundManager.playSound(new TTSSound("",false));
   
    String string = "\n";
    for (cero.games.Player players : game.getPlayers()){
      String substring = players.getPlayerName() + " : " + ((UnoPlayer) players).getPoints() + " points\n";
      string += substring;
      SoundManager.playSound(new TTSSound(substring + ".",false));
    }
   
View Full Code Here

Examples of cero.games.uno.UnoGame

    Player p = g.getPlayers().get(0);
    DeckLayoutBase deckLayoutBase = new DeckLayoutBase();
    this.setDeckLayout(deckLayoutBase);
   
    if (g instanceof UnoGame) {
      UnoGame game = (UnoGame)g;
     
      // create graphical zones need for Uno game
      GraphicsZone Talon = new GraphicsZoneColor(game.getZones().get("Talon"));
      GraphicsZone Hand = new GraphicsZoneBase(p.getZones().get("Hand"));
      Hand.setZoneLayout(new ZoneLayoutOverLapH());
      HashMap<Player,GraphicsZone> gZoneIAMap = new HashMap<Player,GraphicsZone>();
      int i = 0;
      for(Player z : g.getPlayers()){
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.