forked from ho-dev/HattrickOrganizer
-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
146 additions
and
86 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
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
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
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,36 @@ | ||
package core.model.player; | ||
|
||
public enum TrainerStatus { | ||
// 1 = PlayingTrainer, 2 = OnlyTrainer, 3 = HoFTrainer | ||
PlayingTrainer(1), | ||
OnlyTrainer(2), | ||
HoFTrainer(3); | ||
|
||
private final int id; | ||
|
||
TrainerStatus(int i) { | ||
this.id = i; | ||
} | ||
|
||
public static TrainerStatus fromInt(Integer i){ | ||
if ( i != null) { | ||
return switch (i) { | ||
case 1 -> PlayingTrainer; | ||
case 2 -> OnlyTrainer; | ||
case 3 -> HoFTrainer; | ||
default -> null; | ||
}; | ||
} | ||
return null; | ||
} | ||
|
||
public static Integer toInteger(TrainerStatus trainerStatus) { | ||
if ( trainerStatus != null) return trainerStatus.toInt(); | ||
return null; | ||
} | ||
|
||
public int toInt(){ | ||
return this.id; | ||
} | ||
|
||
} |