mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-28 19:35:23 +00:00
[AB-66] adding min mines ratio and other input restrictions for mines game which should avoid some too easy setups
This commit is contained in:
@@ -13,6 +13,7 @@ public class EconomyFeatureConfig implements FeatureConfig {
|
||||
public static final String PAYDAY_CREDITS_CONFIG_KEY = "paydayCredits";
|
||||
public static final String PAYDAY_COOLDOWN_CONFIG_KEY = "paydayCooldown";
|
||||
public static final String SLOTS_COOLDOWN_CONFIG_KEY = "slotsCooldown";
|
||||
public static final String MINES_MINIMUM_MINES_RATIO = "minesMinMineRatio";
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
@@ -21,6 +22,6 @@ public class EconomyFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredSystemConfigKeys() {
|
||||
return Arrays.asList(PAYDAY_CREDITS_CONFIG_KEY, PAYDAY_COOLDOWN_CONFIG_KEY, SLOTS_COOLDOWN_CONFIG_KEY);
|
||||
return Arrays.asList(PAYDAY_CREDITS_CONFIG_KEY, PAYDAY_COOLDOWN_CONFIG_KEY, SLOTS_COOLDOWN_CONFIG_KEY, MINES_MINIMUM_MINES_RATIO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
package dev.sheldan.abstracto.entertainment.exception;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoTemplatableException;
|
||||
import dev.sheldan.abstracto.entertainment.model.exception.InvalidGameBoardExceptionModel;
|
||||
|
||||
public class InvalidGameBoardException extends AbstractoTemplatableException {
|
||||
|
||||
private final InvalidGameBoardExceptionModel model;
|
||||
|
||||
public InvalidGameBoardException(Double minRatio) {
|
||||
super();
|
||||
this.model = InvalidGameBoardExceptionModel
|
||||
.builder()
|
||||
.minMinesRatio(minRatio)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "invalid_mine_board_config_exception";
|
||||
@@ -10,6 +22,6 @@ public class InvalidGameBoardException extends AbstractoTemplatableException {
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return new Object();
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.sheldan.abstracto.entertainment.model.exception;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class InvalidGameBoardExceptionModel {
|
||||
private Double minMinesRatio;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import dev.sheldan.abstracto.entertainment.model.command.games.MineBoard;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
public interface GameService {
|
||||
MineBoard createBoard(Integer width, Integer height, Integer mines);
|
||||
MineBoard createBoard(Integer width, Integer height, Integer mines, Long serverId);
|
||||
void persistMineBoardMessage(MineBoard mineBoard, Message message);
|
||||
void updateMineBoard(MineBoard mineBoard);
|
||||
void uncoverBoard(MineBoard mineBoard);
|
||||
|
||||
Reference in New Issue
Block a user