diff --git a/src/main/java/com/snowthon/snowman/domain/wear/HeadWear.java b/src/main/java/com/snowthon/snowman/domain/wear/HeadWear.java index dc2a200..19d5153 100644 --- a/src/main/java/com/snowthon/snowman/domain/wear/HeadWear.java +++ b/src/main/java/com/snowthon/snowman/domain/wear/HeadWear.java @@ -55,17 +55,17 @@ public void updateVote(EHeadWear headWear) { } else if (headWear == EHeadWear.BALACLAVA) { this.balaclavaCnt++; } - double totalVotes = earmuffCnt + balaclavaCnt; - double earmuffScore = (totalVotes > 0) ? (earmuffCnt / totalVotes) * 0.5 : 0; - double balaclavaScore = (totalVotes > 0) ? (balaclavaCnt / totalVotes) * 0.5 : 0; - if (this.eheadWear == EHeadWear.EAR_MUFFS) { - earmuffScore += 0.5; - } else if (this.eheadWear == EHeadWear.BALACLAVA) { - balaclavaScore += 0.5; - } else if (this.eheadWear == EHeadWear.NONE) { - return; - } - this.eheadWear = earmuffScore > balaclavaScore ? EHeadWear.EAR_MUFFS : EHeadWear.BALACLAVA; +// double totalVotes = earmuffCnt + balaclavaCnt; +// double earmuffScore = (totalVotes > 0) ? (earmuffCnt / totalVotes) * 0.5 : 0; +// double balaclavaScore = (totalVotes > 0) ? (balaclavaCnt / totalVotes) * 0.5 : 0; +// if (this.eheadWear == EHeadWear.EAR_MUFFS) { +// earmuffScore += 0.5; +// } else if (this.eheadWear == EHeadWear.BALACLAVA) { +// balaclavaScore += 0.5; +// } else if (this.eheadWear == EHeadWear.NONE) { +// return; +// } + this.eheadWear = this.earmuffCnt >= this.balaclavaCnt ? EHeadWear.EAR_MUFFS : EHeadWear.BALACLAVA; } } diff --git a/src/main/java/com/snowthon/snowman/domain/wear/NeckWear.java b/src/main/java/com/snowthon/snowman/domain/wear/NeckWear.java index d5ef29c..505de7a 100644 --- a/src/main/java/com/snowthon/snowman/domain/wear/NeckWear.java +++ b/src/main/java/com/snowthon/snowman/domain/wear/NeckWear.java @@ -47,13 +47,13 @@ public void updateVote(ENeckWear neckWear) { if (neckWear == ENeckWear.SCARF) { this.scarfCnt++; } - double totalVotes = scarfCnt; - double scarfScore = (totalVotes > 0) ? (scarfCnt / totalVotes) * 0.5 : 0; - if (this.eNeckWear == ENeckWear.SCARF) { - scarfScore += 0.5; - } else if (this.eNeckWear == ENeckWear.NONE) { - return; - } - this.eNeckWear = scarfScore > 0.5 ? ENeckWear.SCARF : ENeckWear.NONE; +// double totalVotes = scarfCnt; +// double scarfScore = (totalVotes > 0) ? (scarfCnt / totalVotes) * 0.5 : 0; +// if (this.eNeckWear == ENeckWear.SCARF) { +// scarfScore += 0.5; +// } else if (this.eNeckWear == ENeckWear.NONE) { +// return; +// } + this.eNeckWear = this.scarfCnt > 0 ? ENeckWear.SCARF : ENeckWear.NONE; } } diff --git a/src/main/java/com/snowthon/snowman/domain/wear/OuterWear.java b/src/main/java/com/snowthon/snowman/domain/wear/OuterWear.java index 45ea7b4..e130115 100644 --- a/src/main/java/com/snowthon/snowman/domain/wear/OuterWear.java +++ b/src/main/java/com/snowthon/snowman/domain/wear/OuterWear.java @@ -65,7 +65,7 @@ public void updateVote(EOuterWear outerWear) { } else if (outerWear == EOuterWear.COAT) { this.coatCnt++; } - double totalVotes = longPaddingCnt + shortPaddingCnt + coatCnt; + /* double totalVotes = longPaddingCnt + shortPaddingCnt + coatCnt; double longPaddingScore = (totalVotes > 0) ? (longPaddingCnt / totalVotes) * 0.33 : 0; double shortPaddingScore = (totalVotes > 0) ? (shortPaddingCnt / totalVotes) * 0.33 : 0; double coatScore = (totalVotes > 0) ? (coatCnt / totalVotes) * 0.33 : 0; @@ -77,7 +77,7 @@ public void updateVote(EOuterWear outerWear) { coatScore += 0.33; } else if(this.eOuterWear == EOuterWear.NONE){ return; - } - this.eOuterWear = (longPaddingScore > shortPaddingScore) ? (longPaddingScore > coatScore ? EOuterWear.LONG_PADDING : EOuterWear.COAT) : (shortPaddingScore > coatScore ? EOuterWear.SHORT_PADDING : EOuterWear.COAT); + }*/ + this.eOuterWear = (this.longPaddingCnt >= this.shortPaddingCnt) ? (this.longPaddingCnt >= this.coatCnt ? EOuterWear.LONG_PADDING : EOuterWear.COAT) : (this.shortPaddingCnt >= this.coatCnt ? EOuterWear.SHORT_PADDING : EOuterWear.COAT); } } diff --git a/src/main/java/com/snowthon/snowman/domain/wear/TopWear.java b/src/main/java/com/snowthon/snowman/domain/wear/TopWear.java index f0c6d7b..df48c19 100644 --- a/src/main/java/com/snowthon/snowman/domain/wear/TopWear.java +++ b/src/main/java/com/snowthon/snowman/domain/wear/TopWear.java @@ -55,7 +55,7 @@ public void updateVote(ETopWear topWear) { } else if (topWear == ETopWear.LONG_SLEEVE) { this.longSleeveCnt++; } - double totalVotes = neatCnt + longSleeveCnt; + /* double totalVotes = neatCnt + longSleeveCnt; double neatScore = (totalVotes > 0) ? (neatCnt / totalVotes) * 0.5 : 0; double longSleeveScore = (totalVotes > 0) ? (longSleeveCnt / totalVotes) * 0.5 : 0; @@ -63,7 +63,7 @@ public void updateVote(ETopWear topWear) { neatScore += 0.5; }else{ longSleeveScore += 0.5; - } - this.eTopWear = longSleeveScore > neatScore ? ETopWear.LONG_SLEEVE : ETopWear.NEAT; + }*/ + this.eTopWear = this.longSleeveCnt >= this.neatCnt ? ETopWear.LONG_SLEEVE : ETopWear.NEAT; } }