Package hand

Examples of hand.WarHand


   * for each behaviour.
   */
  public void testDrawing()
  {
    HandBehaviour behaviours[] = {
        new BlackJackHand(), new MemoryHand(), new WarHand(), new GoFishHand()};
    int startSizes[] = {0, 0, 26, 7};
    for (int i = 0; i < behaviours.length; i++)
    {
      player = new Player(behaviours[i]);
      player.draw();
View Full Code Here


     * @param player2 The CheatingBehavior for player 2
     */
    public PlayerController(CheatingBehavior player1, CheatingBehavior player2)
    {
        players = new Vector<WarPlayer>();
        players.add(new WarPlayer(new WarHand(), player1));
        players.add(new WarPlayer(new WarHand(), player2));
        player1Card = null;
        player2Card = null;
        cardsOnScreen = new ArrayList<Card>();
        time = WarTimer.getInstance();
        //view.addCard(new Card(9, 'h'), 0, 0, false);
View Full Code Here

     */
    @Test
    public void testInit()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
       
        assertEquals(cheat, player.howToCheat);
    }
View Full Code Here

     */
    @Test
    public void testCheat()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertTrue(player.cheat() != null);
    }
View Full Code Here

     */
    @Test
    public void testTakeTurn()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertTrue(player.takeTurn() != null);
    }
View Full Code Here

     */
    @Test
    public void testWar()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        Card array[] = player.war();
       
        assertTrue(array[0] != null);
        assertTrue(array[1] != null);
View Full Code Here

     */
    @Test
    public void testWarSmallHand()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        ArrayList<Card> cards = new ArrayList<Card>();
       
        Card c1 = new Card(6, 'c');
        Card c2 = new Card(5, 'c');
View Full Code Here

     */
    @Test
    public void testAddCardsToHand()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        ArrayList<Card> cards = new ArrayList<Card>();
       
        Card c1 = new Card(6, 'c');
        Card c2 = new Card(5, 'c');
View Full Code Here

     */
    @Test
    public void testClearHand()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertEquals(26, player.getHandSize());
        player.clearHand();
        assertEquals(0, player.getHandSize());
    }
View Full Code Here

TOP

Related Classes of hand.WarHand

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.