Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team 5 - Smart Towns
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rhys Evans
Team 5 - Smart Towns
Commits
ac7592fa
Commit
ac7592fa
authored
1 year ago
by
Gabriel Copat
Browse files
Options
Downloads
Patches
Plain Diff
Added Object for Pack
Removed "String pack" variable from Object Sticker
parent
2531a0af
No related branches found
No related tags found
1 merge request
!33
Resolve "As a QR-scanning connoisseur , I want to unlock stickers after scanning a QR code to feel a sense of reward."
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/team5/smartTowns/rewards/Pack.java
+27
-0
27 additions, 0 deletions
src/main/java/team5/smartTowns/rewards/Pack.java
src/main/java/team5/smartTowns/rewards/Sticker.java
+1
-2
1 addition, 2 deletions
src/main/java/team5/smartTowns/rewards/Sticker.java
with
28 additions
and
2 deletions
src/main/java/team5/smartTowns/rewards/Pack.java
0 → 100644
+
27
−
0
View file @
ac7592fa
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"
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/team5/smartTowns/rewards/Sticker.java
+
1
−
2
View file @
ac7592fa
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment