-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeck.java
More file actions
55 lines (41 loc) · 1.04 KB
/
Deck.java
File metadata and controls
55 lines (41 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.example.thoma.flashcards2;
import android.util.Log;
import java.util.ArrayList;
public class Deck {
ArrayList<Card> Cards = new ArrayList<Card>();
String name;
boolean active;
public Deck(String name){
this.name = name;
active = true;
}
public Deck(String name, boolean active){
this.name = name;
this.active = active;
}
public void editName(String name){
this.name = name;
}
public void addCard(Card card){
Cards.add(card);
}
public void removeCard(int pos){
Cards.remove(pos);
Log.d("removeCard", "Removed card successfully" + Cards);
}
public Card getCard(int pos){
return Cards.get(pos);
}
public String getName(){
return name;
}
public void setActive(boolean active){
this.active = active;
}
public boolean getActive(){
return active;
}
public int getSize(){
return Cards.size();
}
}