DimDoors/StevenDimDoors/mod_pocketDim/dungeon/pack/DungeonPackConfig.java
SenseiKiwi acab06115a Progress on Implementing Dungeon Packs
Added code for parsing dungeon pack config files. The settings for our
built-in dungeons are now read from a file instead of being hardcoded.
One or two settings aren't being accessed yet and we still don't search
for other dungeon packs in the custom dungeon folder.  That'll come in
another commit.
2013-08-20 18:54:30 -04:00

126 lines
2.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 boolean allowPackChangeIn;
private boolean allowPackChangeOut;
private boolean distortDoorCoordinates;
private int packWeight;
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.allowPackChangeIn = source.allowPackChangeIn;
this.allowPackChangeOut = source.allowPackChangeOut;
this.distortDoorCoordinates = source.distortDoorCoordinates;
this.packWeight = source.packWeight;
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;
}
public boolean allowPackChangeIn()
{
return allowPackChangeIn;
}
public void setAllowPackChangeIn(boolean value)
{
this.allowPackChangeIn = value;
}
public boolean allowPackChangeOut()
{
return allowPackChangeOut;
}
public void setAllowPackChangeOut(boolean value)
{
this.allowPackChangeOut = value;
}
public int getPackWeight()
{
return packWeight;
}
public void setPackWeight(int packWeight)
{
this.packWeight = packWeight;
}
public boolean getDistortDoorCoordinates()
{
return distortDoorCoordinates;
}
public void setDistortDoorCoordinates(boolean value)
{
this.distortDoorCoordinates = value;
}
}