-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
902 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/io/github/sefiraat/crystamaehistoria/player/BlockRank.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package io.github.sefiraat.crystamaehistoria.player; | ||
|
||
import io.github.sefiraat.crystamaehistoria.utils.theme.ThemeType; | ||
import lombok.Getter; | ||
|
||
public enum BlockRank { | ||
|
||
SME(100, ThemeType.RANK_BLOCK_SME), | ||
MASTER_OF(90, ThemeType.RANK_BLOCK_MASTER_OF), | ||
EXPERT_OF(70, ThemeType.RANK_BLOCK_EXPERT_OF), | ||
RESEARCHED(50, ThemeType.RANK_BLOCK_RESEARCHED), | ||
DETAILED(30, ThemeType.RANK_BLOCK_DETAILED), | ||
KNOWN(20, ThemeType.RANK_BLOCK_KNOWN), | ||
HEARD_OF(10, ThemeType.RANK_BLOCK_HEARD_OF), | ||
UNKNOWN(0, ThemeType.RANK_BLOCK_UNKNOWN); | ||
|
||
private final double numberRequired; | ||
@Getter | ||
private final ThemeType theme; | ||
|
||
BlockRank(double numberRequired, ThemeType themeType) { | ||
this.numberRequired = numberRequired; | ||
this.theme = themeType; | ||
} | ||
|
||
public static BlockRank getByAmount(double percent) { | ||
if (percent >= SME.numberRequired) { | ||
return SME; | ||
} else if (percent >= MASTER_OF.numberRequired) { | ||
return MASTER_OF; | ||
} else if (percent >= EXPERT_OF.numberRequired) { | ||
return EXPERT_OF; | ||
} else if (percent >= RESEARCHED.numberRequired) { | ||
return RESEARCHED; | ||
} else if (percent >= DETAILED.numberRequired) { | ||
return DETAILED; | ||
} else if (percent >= KNOWN.numberRequired) { | ||
return KNOWN; | ||
} else if (percent >= HEARD_OF.numberRequired) { | ||
return HEARD_OF; | ||
} else { | ||
return UNKNOWN; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.