Package belotetime.application.game

Examples of belotetime.application.game.Player


  Pack hand;
  Card c1, c2, c3;
 
  public TestPlayer()
  {
    p = new Player("Test");
    listCards = new ArrayList<>();
        c1 = new Card("Dame", "Coeur", 3);
        c2 = new Card("Roi", "Coeur", 4);
        c3 = new Card("As", "Pique", 11);
        c3.setTrump(true);
View Full Code Here


 
  public TestXmlFeeds()
  {
    g = new Game();
   
    g.getPlayers().add(new Player("Joueur 1"));
    g.getPlayers().add(new Player("Joueur 2"));
    g.getPlayers().add(new Player("Joueur 3"));
    g.getPlayers().add(new Player("Joueur 4"));
   
    g.addPlayer(g.getT1(), g.getPlayers().get(0));
    g.addPlayer(g.getT2(), g.getPlayers().get(1));
    g.addPlayer(g.getT1(), g.getPlayers().get(2));
    g.addPlayer(g.getT2(), g.getPlayers().get(3));
View Full Code Here

 
  @Test
  public void testXmlToPlayer()
  {
    String xml = "<player><login>name</login><hand><card><name>Neuf</name><color>Pique</color><value>14</value><trump>true</trump><img></img></card>";
    Player p = XmlFeeds.xmlToPlayer(xml);
    assertEquals(p.getLogin(), "name");
    assertEquals(p.getHand().getCards().get(0).getName(), "Neuf");
  }
View Full Code Here

        listCards.add(new Card("Dame", "Pique", 3));
        listCards.add(new Card("Roi", "Pique", 4));
        listCards.add(new Card("As", "Pique", 11));
       
        game = new Game(new Pack(listCards));
        game.getPlayers().add(new Player("Joueur 1"));
        game.getPlayers().add(new Player("Joueur 2"));
        game.getPlayers().add(new Player("Joueur 3"));
        game.getPlayers().add(new Player("Joueur 4"));
        game.setCurrentSet(new Set(game, game.getPlayers().get(3)));
       
        set = game.getCurrentSet();
  }
View Full Code Here

  public void start()
  {
    online = false;
   
    // On ajoute des joueurs dans les �quipes
    game.getT1().setP1(new Player("Joueur 1"));
    game.getT2().setP1(new Player("Joueur 2"));
    game.getT1().setP2(new Player("Joueur 3"));
    game.getT2().setP2(new Player("Joueur 4"));
   
    // On ins�re les joueurs dans la liste des players de la partie.
    /*game.getPlayers().add(game.getT1().getP1());
    game.getPlayers().add(game.getT2().getP1());
    game.getPlayers().add(game.getT1().getP2());
 
View Full Code Here

        e.printStackTrace();
      }
    }
    else
    {
      Player p = game.getPlayers().get(numPlayer);
      game.getCarpet().getCards().add(p.playCard(numCard));
      game.getCurrentSet().nextStarter();
      notifyView(game);
      if ((game.getPlayers().indexOf(game.getCurrentSet().getStarter()) != 0) && (game.getCarpet().getCards().size() < 4))
      {
        basicAI();
View Full Code Here

   * @param numPlayer Le num�ro du joueur
   * @throws IOException
   */
  private synchronized void connect(String str, int numPlayer) throws IOException
  {
    Player p = new Player(XmlFeeds.xmlGetTag(str, "player"));
   
    switch(numPlayer)
    {
      case 0 :
        server.getGame().getT1().setP1(p);
View Full Code Here

    server.getGame().getCurrentSet().firstDeal(Set.THREE_CARDS);
  }
 
  private synchronized void addPlayer(String xml, int numPlayer) throws IOException
  {
    Player p = new Player(XmlFeeds.xmlGetTag(xml, "player"));
   
    switch(numPlayer)
    {
      case 0 :
        server.getGame().getT1().setP1(p);
View Full Code Here

              server.getGame().getCurrentSet().alterTrumpValue();
              connect();
              break;
            case "playCard" :
              player = Integer.parseInt(XmlFeeds.xmlGetTag(data, "player"));
              Player p = server.getGame().getPlayers().get(player);
             
              boolean b = Boolean.parseBoolean(XmlFeeds.xmlGetTag(data, "belote"));
              if(b) server.getGame().getCurrentSet().playBelote();
             
              if(server.getGame().getCurrentSet().getBelotePlayed() == 2)
              {
                Team t = player % 2 == 0 ? server.getGame().getT1() : server.getGame().getT2();
                t.setBelote(true);
              }
             
              int numCard = Integer.parseInt(XmlFeeds.xmlGetTag(data, "card"));
              server.getGame().getCarpet().getCards().add(p.playCard(numCard));
              server.getGame().getCurrentSet().nextStarter();
              connect();
              break;
            case "initTrick" :
              //Fin du pli
View Full Code Here

TOP

Related Classes of belotetime.application.game.Player

Copyright © 2018 www.massapicom. 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.