Skip to content

Commit

Permalink
Merge pull request #26 from ThisIsComedy/feat/#25
Browse files Browse the repository at this point in the history
통계 업데이트 로직에서 아낀 돈 부분 수정
  • Loading branch information
hw9402 authored Nov 14, 2023
2 parents 727d3e8 + be75e88 commit f81dc4b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ public Stats(User user, Integer noSmokeDay, Integer saveMoney, Integer currentCo
}

public Stats updateByScheduling() {
int cigarettePrice = user.getCigarettePrice();
int smokePerDay = user.getSmokePerDay();

int packsPerDay = smokePerDay / 20;
int remainingCigarettes = smokePerDay % 20;

saveMoney += packsPerDay * cigarettePrice + cigarettePrice / (20 - remainingCigarettes);
noSmokeDay += 1;
saveMoney += user.getCigarettePrice();
currentContinuityNoSmoke += 1;
maximumContinuityNoSmoke += 1;

Expand Down

0 comments on commit f81dc4b

Please sign in to comment.