Progress on Implementing Dungeon Packs

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.
This commit is contained in:
SenseiKiwi
2013-08-05 09:48:49 -04:00
parent e96fc02747
commit 101e9e4ce6
10 changed files with 298 additions and 157 deletions

View File

@@ -1,22 +1,36 @@
package StevenDimDoors.mod_pocketDim.dungeon.pack;
import java.util.ArrayList;
import java.util.List;
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);
@@ -24,26 +38,41 @@ public class DungeonPackConfig
public String getName()
{
return null;
return name;
}
public void setName(String name)
{
this.name = name;
}
public List<String> getTypeNames()
public ArrayList<String> getTypeNames()
{
return null;
return typeNames;
}
public void setTypeNames(ArrayList<String> typeNames)
{
this.typeNames = typeNames;
}
public boolean allowDuplicatesInChain()
{
return false;
return allowDuplicatesInChain;
}
public void setAllowDuplicatesInChain(boolean value)
{
allowDuplicatesInChain = value;
}
public void setRules(Object object) {
// TODO Auto-generated method stub
public void setRules(ArrayList<DungeonChainRuleDefinition> rules)
{
this.rules = rules;
}
public ArrayList<DungeonChainRule> getRules() {
// TODO Auto-generated method stub
return null;
public ArrayList<DungeonChainRuleDefinition> getRules()
{
return rules;
}
}