Clover Coverage Report - HeartsSkyThread Coverage Report
Coverage timestamp: gio dic 18 2014 15:52:24 EST
../../../../img/srcFileCovDistChart4.png 61% of files have more coverage
32   119   22   1,88
10   81   0,69   17
17     1,29  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  Deck       Line # 6 32 22 39% 0.3898305
 
No Tests
 
1    package game.shad.tempus.hearts;
2   
3   
4    import java.util.ArrayList;
5   
 
6    public class Deck {
7   
8    private ArrayList<Card> deck;
9   
 
10  2685 toggle public Deck(){
11  2685 deck = new ArrayList<Card>();
12    }
13   
 
14  19982 toggle public void addCard(Card card){
15  19982 this.deck.add(card);
16    }
17   
 
18  60 toggle public ArrayList<Card> getDeck(){
19  60 return this.deck;
20    }
 
21  3816 toggle public void addAllCards(Deck cards){
22  46153 for(int i = 0; i<cards.getSize();i++){
23  42337 this.deck.add(cards.getCard(i));
24    }
25    }
26   
 
27  18 toggle public void removeCard(Card card){
28  18 this.deck.remove(card);
29    }
30   
 
31  17527 toggle public void removeCardAtIndex(int i){
32  17527 this.deck.remove(i);
33    }
34   
 
35  5468 toggle public void addCardAtIndex(int index, Card card) {
36  5468 this.deck.add(index, card);
37   
38    }
 
39  2396 toggle public void clearALL(){
40  2396 this.deck.clear();
41    }
42   
 
43  0 toggle public void cloneMe(){
44   
45  0 this.deck.clear();
46    }
47   
48   
 
49  0 toggle public void updateDeck(Deck deck2){
50  0 this.deck.clear();
51  0 for(int i=0;i<deck.size();i++){
52  0 this.deck.add(deck2.getCard(i));
53    }
54    }
 
55  0 toggle public int getIndex(Card card){
56   
57  0 return this.deck.indexOf(card);
58    }
59   
 
60  63001 toggle public int getSize(){
61  63001 return this.deck.size();
62    }
63   
64   
65   
66   
67   
68    //returns a card at an index
 
69  72613 toggle public Card getCard(int index){
70  72613 return this.deck.get(index);
71    }
 
72  0 toggle public void setDeck(ArrayList<Card> deck) {
73  0 this.deck = deck;
74    }
75    //Gets the card in the middle, so we can show it in the graphic
 
76  0 toggle public Card getMiddleCard(){
77  0 Card c = null;
78   
79  0 if(getSize() >= 1){
80  0 c = getCard((int)Math.ceil(getSize()/2));
81    }else{
82  0 c = getCard(1);
83    }
84   
85  0 return c;
86    }
87   
88    //Get card to the left of an index (for graphics)
 
89  0 toggle public Card getLeftCard(int index){
90  0 Card c = null;
91   
92  0 if(index > 0)
93    {
94  0 c = this.getCard(index - 1);
95    }else{
96  0 c = this.getCard(0);
97    }
98   
99  0 return c;
100    }
101   
102    //Get card to the right of an index (for graphics)
 
103  0 toggle public Card getRightCard(int index){
104  0 Card c = null;
105   
106  0 if(index < this.getSize())
107    {
108  0 c = this.getCard(index + 1);
109    }else{
110  0 c = this.getCard(this.getSize());
111    }
112   
113  0 return c;
114    }
115   
116   
117   
118   
119    }