Skip to content
Snippets Groups Projects
Commit ac7592fa authored by Gabriel Copat's avatar Gabriel Copat
Browse files

Added Object for Pack

Removed "String pack" variable from Object Sticker
parent 2531a0af
No related branches found
No related tags found
1 merge request!33Resolve "As a QR-scanning connoisseur , I want to unlock stickers after scanning a QR code to feel a sense of reward."
package team5.smartTowns.rewards;
import lombok.Getter;
import java.util.List;
@Getter
public class Pack extends Reward{
int progression; //0-100%;
public Pack(int id, String name, String description) {
super(id, name, description);
}
public void setProgression(List<Sticker> packStickers, List<Sticker> userStickers){
/* Takes in a list with all stickers in the pack and a list with all userStickers from the pack
* These lists are taken from database in the Controllers via SQL query*/
int totalAmount = packStickers.size();
int hasAmount = userStickers.size();
progression = (int) ((totalAmount/hasAmount) * 100);
}
@Override
public String getImgFolder() {
return "packs";
}
}
...@@ -10,9 +10,8 @@ public class Sticker extends Reward{ ...@@ -10,9 +10,8 @@ public class Sticker extends Reward{
int rarity; //1-5 int rarity; //1-5
boolean hasSticker; boolean hasSticker;
String pack;
public Sticker(int id, String name, String description, int rarity, String pack) { public Sticker(int id, String name, String description, int rarity) {
super(id, name, description); super(id, name, description);
this.rarity = rarity; this.rarity = rarity;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment