Completed enough of the implementation and integration to compile DD. Some portions of the code are only for testing and will be removed later. The configuration for default dungeons is hardcoded - we can parse config files once we're certain that dungeon chains work. At the moment, dungeons generate but it doesn't seem like the rules we set are being followed properly. Renamed OptimizedRule to DungeonChainRule, and renamed the old DungeonChainRule to DungeonChainRuleDefinition, to match the role of each class better. Added some hax to DungeonGenerator to get packs integrated - the implementation will be much cleaner once the new save format is done.
79 lines
1.6 KiB
Java
79 lines
1.6 KiB
Java
package StevenDimDoors.mod_pocketDim.dungeon.pack;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
public class DungeonPackConfig
|
|
{
|
|
private String name;
|
|
private ArrayList<String> typeNames;
|
|
private boolean allowDuplicatesInChain;
|
|
private ArrayList<DungeonChainRuleDefinition> rules;
|
|
|
|
public DungeonPackConfig() { }
|
|
|
|
@SuppressWarnings("unchecked")
|
|
private DungeonPackConfig(DungeonPackConfig source)
|
|
{
|
|
this.name = source.name;
|
|
this.typeNames = (ArrayList<String>) source.typeNames.clone();
|
|
this.allowDuplicatesInChain = source.allowDuplicatesInChain;
|
|
this.rules = (ArrayList<DungeonChainRuleDefinition>) source.rules.clone();
|
|
}
|
|
|
|
public void validate()
|
|
{
|
|
if (this.name == null)
|
|
throw new NullPointerException("name cannot be null");
|
|
if (this.typeNames == null)
|
|
throw new NullPointerException("typeNames cannot be null");
|
|
if (this.rules == null)
|
|
throw new NullPointerException("rules cannot be null");
|
|
}
|
|
|
|
@Override
|
|
public DungeonPackConfig clone()
|
|
{
|
|
return new DungeonPackConfig(this);
|
|
}
|
|
|
|
public String getName()
|
|
{
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name)
|
|
{
|
|
this.name = name;
|
|
}
|
|
|
|
public ArrayList<String> getTypeNames()
|
|
{
|
|
return typeNames;
|
|
}
|
|
|
|
public void setTypeNames(ArrayList<String> typeNames)
|
|
{
|
|
this.typeNames = typeNames;
|
|
}
|
|
|
|
public boolean allowDuplicatesInChain()
|
|
{
|
|
return allowDuplicatesInChain;
|
|
}
|
|
|
|
public void setAllowDuplicatesInChain(boolean value)
|
|
{
|
|
allowDuplicatesInChain = value;
|
|
}
|
|
|
|
public void setRules(ArrayList<DungeonChainRuleDefinition> rules)
|
|
{
|
|
this.rules = rules;
|
|
}
|
|
|
|
public ArrayList<DungeonChainRuleDefinition> getRules()
|
|
{
|
|
return rules;
|
|
}
|
|
}
|