Skip to content
Snippets Groups Projects

Resolve "As a QR-scanning connoisseur , I want to unlock stickers after scanning a QR code to feel a sense of reward."

2 files
+ 28
2
Compare changes
  • Side-by-side
  • Inline
Files
2
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";
}
}
Loading