I'm working on a set game program for school. I have the following constructor for cards:
public SetCard(Colors c, Shapes sp, Shading sd, Numbers num)
{
this.color = c;
this.shape = sp;
this.shade = sd;
this.number = num;
}
I am trying to create a deck constructor which makes card with each combination of the four enum types:
public setDeck()
{
ArrayList<Card> cards = new ArrayList<Card>(CARDS_IN_DECK);
for (Colors c : Colors.values()) {
for (Shapes sp : Shapes.values()) {
for (Shading sd : Shading.values()) {
for (Numbers num : Numbers.values()) {
cards.add(new SetCard(c, sp, sd, num));
}
}
}
}
return cards;
}
When I compile I get an error telling me "constructor SetCard in class SetCard cannot be applied to given types"
My SetCard constructor takes in enum types for arguments so I don't understand why this is happening.
voidfrom the methodSetCardto make it a constructor?voidback onsetDeck()since that's a method