2013-08-05 01:27:34 +02:00
|
|
|
package StevenDimDoors.mod_pocketDim.dungeon.pack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
public class DungeonPackConfig
|
|
|
|
{
|
2013-08-05 15:48:49 +02:00
|
|
|
private String name;
|
|
|
|
private ArrayList<String> typeNames;
|
|
|
|
private boolean allowDuplicatesInChain;
|
2013-08-21 00:54:30 +02:00
|
|
|
private boolean allowPackChangeIn;
|
|
|
|
private boolean allowPackChangeOut;
|
|
|
|
private boolean distortDoorCoordinates;
|
|
|
|
private int packWeight;
|
2013-08-05 15:48:49 +02:00
|
|
|
private ArrayList<DungeonChainRuleDefinition> rules;
|
|
|
|
|
2013-08-05 01:27:34 +02:00
|
|
|
public DungeonPackConfig() { }
|
|
|
|
|
2013-08-05 15:48:49 +02:00
|
|
|
@SuppressWarnings("unchecked")
|
2013-08-05 01:27:34 +02:00
|
|
|
private DungeonPackConfig(DungeonPackConfig source)
|
|
|
|
{
|
2013-08-21 20:26:10 +02:00
|
|
|
this.name = (source.name != null) ? source.name : null;
|
|
|
|
this.typeNames = (source.typeNames != null) ? (ArrayList<String>) source.typeNames.clone() : null;
|
2013-08-05 15:48:49 +02:00
|
|
|
this.allowDuplicatesInChain = source.allowDuplicatesInChain;
|
2013-08-21 00:54:30 +02:00
|
|
|
this.allowPackChangeIn = source.allowPackChangeIn;
|
|
|
|
this.allowPackChangeOut = source.allowPackChangeOut;
|
|
|
|
this.distortDoorCoordinates = source.distortDoorCoordinates;
|
|
|
|
this.packWeight = source.packWeight;
|
2013-08-21 20:26:10 +02:00
|
|
|
this.rules = (source.rules != null) ? (ArrayList<DungeonChainRuleDefinition>) source.rules.clone() : null;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void validate()
|
|
|
|
{
|
2013-08-05 15:48:49 +02:00
|
|
|
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");
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
2013-08-05 15:48:49 +02:00
|
|
|
@Override
|
2013-08-05 01:27:34 +02:00
|
|
|
public DungeonPackConfig clone()
|
|
|
|
{
|
|
|
|
return new DungeonPackConfig(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName()
|
|
|
|
{
|
2013-08-05 15:48:49 +02:00
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setName(String name)
|
|
|
|
{
|
|
|
|
this.name = name;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
2013-08-05 15:48:49 +02:00
|
|
|
public ArrayList<String> getTypeNames()
|
|
|
|
{
|
|
|
|
return typeNames;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTypeNames(ArrayList<String> typeNames)
|
2013-08-05 01:27:34 +02:00
|
|
|
{
|
2013-08-05 15:48:49 +02:00
|
|
|
this.typeNames = typeNames;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean allowDuplicatesInChain()
|
|
|
|
{
|
2013-08-05 15:48:49 +02:00
|
|
|
return allowDuplicatesInChain;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAllowDuplicatesInChain(boolean value)
|
|
|
|
{
|
|
|
|
allowDuplicatesInChain = value;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
2013-08-05 15:48:49 +02:00
|
|
|
public void setRules(ArrayList<DungeonChainRuleDefinition> rules)
|
|
|
|
{
|
|
|
|
this.rules = rules;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
|
|
|
|
2013-08-05 15:48:49 +02:00
|
|
|
public ArrayList<DungeonChainRuleDefinition> getRules()
|
|
|
|
{
|
|
|
|
return rules;
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|
2013-08-21 00:54:30 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2013-08-21 20:26:10 +02:00
|
|
|
public boolean doDistortDoorCoordinates()
|
2013-08-21 00:54:30 +02:00
|
|
|
{
|
|
|
|
return distortDoorCoordinates;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDistortDoorCoordinates(boolean value)
|
|
|
|
{
|
|
|
|
this.distortDoorCoordinates = value;
|
|
|
|
}
|
2013-08-05 01:27:34 +02:00
|
|
|
}
|