-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor hiring halls to support different levels; add new hiring halls
- Loading branch information
Showing
5 changed files
with
96 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package mekhq.campaign.universe; | ||
|
||
import mekhq.campaign.universe.enums.HiringHallLevel; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class HiringHall { | ||
private HiringHallLevel level; | ||
private LocalDate startDate; | ||
private LocalDate endDate; | ||
private String planetName; | ||
|
||
public HiringHall(HiringHallLevel level, LocalDate startDate, LocalDate endDate, String planetName) { | ||
this.level = level; | ||
this.startDate = startDate; | ||
this.endDate = endDate; | ||
this.planetName = planetName; | ||
} | ||
|
||
public boolean isActive(LocalDate date) { | ||
return ((startDate == null) || !startDate.isAfter(date)) | ||
&& ((endDate == null) || !endDate.isBefore(date)); | ||
} | ||
|
||
public String getPlanetName() { | ||
return planetName; | ||
} | ||
|
||
public HiringHallLevel getLevel() { | ||
return level; | ||
} | ||
|
||
public void setLevel(HiringHallLevel level) { | ||
this.level = level; | ||
} | ||
} |
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,9 @@ | ||
package mekhq.campaign.universe.enums; | ||
|
||
public enum HiringHallLevel { | ||
NONE, | ||
QUESTIONABLE, | ||
MINOR, | ||
STANDARD, | ||
GREAT | ||
} |