mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- CheckStyle.
This commit is contained in:
@@ -16,21 +16,34 @@ public class SellRules {
|
|||||||
private int maxDifficulty = 5;
|
private int maxDifficulty = 5;
|
||||||
|
|
||||||
public SellRules(List<String> questShop) {
|
public SellRules(List<String> questShop) {
|
||||||
if( null == questShop || questShop.isEmpty() ) return;
|
if (null == questShop || questShop.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (String s : questShop) {
|
for (String s : questShop) {
|
||||||
String[] kv = s.split("=");
|
String[] kv = s.split("=");
|
||||||
if( "WinsToUnlock".equalsIgnoreCase(kv[0]) ) minWins = Integer.parseInt(kv[1]);
|
if ("WinsToUnlock".equalsIgnoreCase(kv[0])) {
|
||||||
else if ("Credits".equalsIgnoreCase(kv[0])) cost = Integer.parseInt(kv[1]);
|
minWins = Integer.parseInt(kv[1]);
|
||||||
else if ("MaxDifficulty".equalsIgnoreCase(kv[0])) maxDifficulty = Integer.parseInt(kv[1]);
|
}
|
||||||
else if ("MinDifficulty".equalsIgnoreCase(kv[0])) minDifficulty = Integer.parseInt(kv[1]);
|
else if ("Credits".equalsIgnoreCase(kv[0])) {
|
||||||
|
cost = Integer.parseInt(kv[1]);
|
||||||
|
}
|
||||||
|
else if ("MaxDifficulty".equalsIgnoreCase(kv[0])) {
|
||||||
|
maxDifficulty = Integer.parseInt(kv[1]);
|
||||||
|
}
|
||||||
|
else if ("MinDifficulty".equalsIgnoreCase(kv[0])) {
|
||||||
|
minDifficulty = Integer.parseInt(kv[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean meetsRequiremnts(QuestData quest)
|
public boolean meetsRequiremnts(QuestData quest) {
|
||||||
{
|
if (quest.getWin() < minWins) {
|
||||||
if( quest.getWin() < minWins ) return false;
|
return false;
|
||||||
if( quest.getDifficultyIndex() < minDifficulty || quest.getDifficultyIndex() > maxDifficulty ) return false;
|
}
|
||||||
|
if (quest.getDifficultyIndex() < minDifficulty || quest.getDifficultyIndex() > maxDifficulty) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user