public abstract class LeveledRecord extends MajorRecord implements java.lang.Iterable<LeveledEntry>
Modifier and Type | Class and Description |
---|---|
static class |
LeveledRecord.LVLFlag
This enum represents the different flags offered by LVLN.
|
MajorRecord.MajorFlags
Constructor and Description |
---|
LeveledRecord(java.lang.String edid)
Creates a new LVLN record with a FormID originating from the mod
parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(FormID id,
int level,
int count)
Adds an entry with the actor, level, and count provided.
|
void |
addEntry(LeveledEntry entry)
Adds the desired entry to the LVLN.
|
void |
clearEntries() |
boolean |
contains(MajorRecord target) |
boolean |
get(LeveledRecord.LVLFlag flag)
Checks a flag of the LVLN given by flag parameter.
|
int |
getChanceNone() |
java.lang.Double |
getChanceNonePct() |
java.util.ArrayList<LeveledEntry> |
getEntries() |
LeveledEntry |
getEntry(int i) |
java.util.ArrayList<LeveledEntry> |
getFlattenedEntries()
Returns all non-leveled list entries, with leveled list entries
recursively replaced with their contents.
|
java.lang.Boolean |
isEmpty() |
java.util.Iterator<LeveledEntry> |
iterator() |
int |
numEntries() |
void |
reduce()
Reduces a Leveled List to have the least entries possible while
maintaining the spawning probabilities.
|
void |
removeAllEntries(FormID id) |
void |
removeEntry(int i)
Removes the ith entry from the LVLN.
|
void |
removeFirstEntry(FormID id) |
int |
replace(MajorRecord target,
MajorRecord replacement) |
void |
set(LeveledRecord.LVLFlag flag,
boolean on)
Sets a flag of the LVLN given by flag parameter
|
void |
setChanceNone(int in)
Sets the chance none for this LVLN.
|
void |
splitEntries()
Reduces leveled list, and then splits it into smaller sub lists if larger
than 255 (the max Skyrim can actually handle).
|
copy, deepEquals, equals, get, getEDID, getForm, getFormMaster, getFormStr, hashCode, print, set, setEDID, setForm, toString
getRecordLength, getType
public LeveledRecord(java.lang.String edid)
edid
- EDID to assign the record. Make sure it's unique.public java.util.Iterator<LeveledEntry> iterator()
iterator
in interface java.lang.Iterable<LeveledEntry>
public void clearEntries()
public java.util.ArrayList<LeveledEntry> getEntries()
public java.util.ArrayList<LeveledEntry> getFlattenedEntries()
public void addEntry(LeveledEntry entry)
entry
- LVLO to add to this LVLNpublic void addEntry(FormID id, int level, int count)
id
- The formID of the actor to put on the entry.level
- Level to mark the entry at.count
- Number of actors to spawn.public int numEntries()
public java.lang.Boolean isEmpty()
public LeveledEntry getEntry(int i)
i
- The zero based index to query.public void removeEntry(int i)
i
- The zero based index to remove.public void removeFirstEntry(FormID id)
id
- public void removeAllEntries(FormID id)
id
- public void reduce()
public java.lang.Double getChanceNonePct()
public void setChanceNone(int in) throws BadParameter
in
- The chance that no creature will spawn from this LVLN.BadParameter
- If in is outside the range: (0-100)public int getChanceNone()
public boolean get(LeveledRecord.LVLFlag flag)
flag
- LVLN_Flags enum representing the flag to check.LVLN_Flags
public final void set(LeveledRecord.LVLFlag flag, boolean on)
flag
- LVLN_Flags enum representing the flag to set.on
- Boolean to set flag to.LVLN_Flags
public final boolean contains(MajorRecord target)
target
- public final int replace(MajorRecord target, MajorRecord replacement)
target
- Record to look for.replacement
- Record to replace with.public void splitEntries()