public class EVStore extends java.lang.Object implements IStatStore
Modifier and Type | Field and Description |
---|---|
static int |
MAX_EVS |
static int |
MAX_TOTAL_EVS |
Constructor and Description |
---|
EVStore()
Initializes an EV store with 0 EVs.
|
EVStore(java.util.HashMap<BattleStatsType,java.lang.Integer> evGain) |
EVStore(int... evs)
Initializes an EV store.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEVsOfType(BattleStatsType stat,
int evIncrease,
int maxValue)
Adds EVs to a Pokémon from a vitamin or wing.
|
boolean |
berryEVs(BattleStatsType stat)
Reduces the Pokémon's EVs from a Berry.
|
EVStore |
cloneEVs()
Makes a copy of the Pokémon's EVs.
|
void |
doubleValues()
Doubles all EV values.
|
void |
fillFromArray(int... evs)
Updates the given variables based on the array provided
|
void |
gainEV(EVYields evYields)
Adds EVs to the Pokémon.
|
int[] |
getArray()
Gets an array of the EVs in the store.
|
int |
getStat(BattleStatsType type)
Gets the EVs for a stat.
|
void |
markDirty()
Marks the
EnumUpdateType.EVs and EnumUpdateType.Stats as dirty on the owner pokemon |
void |
randomizeMaxEVs()
Allocates all EVs into random stats.
|
EVStore |
readFromByteBuffer(io.netty.buffer.ByteBuf buf)
Reads the Pokemon's EVs from a ByteBuffer
|
void |
readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
Reads the Pokémon's EVs from NBT.
|
void |
setStat(BattleStatsType type,
int value)
Sets the EVs for a stat.
|
boolean |
vitaminEVs(BattleStatsType stat)
Adds EVs to a Pokémon from a vitamin.
|
boolean |
wingEVs(BattleStatsType stat)
Adds EVs to a Pokémon from a wing.
|
EVStore |
withPokemon(Pokemon pokemon)
Sets the pokemon related to these EVs
|
void |
writeToByteBuffer(io.netty.buffer.ByteBuf buf)
Writes the Pokemon's EVs to a ByteBuffer
|
void |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
Writes the Pokémon's EVs to NBT.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addStat, getTotal, takeStat
public static final int MAX_EVS
public static final int MAX_TOTAL_EVS
public EVStore()
public EVStore(int... evs)
evs
- The EVs to initializes the store to.public EVStore(java.util.HashMap<BattleStatsType,java.lang.Integer> evGain)
public EVStore withPokemon(Pokemon pokemon)
pokemon
- The new pokemonpublic int getStat(BattleStatsType type)
getStat
in interface IStatStore
type
- The stat to get EVs for.public void setStat(BattleStatsType type, int value)
MAX_TOTAL_EVS
setStat
in interface IStatStore
type
- The stat to get EVs for.value
- The value to set the EV to.public void markDirty()
EnumUpdateType.EVs
and EnumUpdateType.Stats
as dirty on the owner pokemonpublic void fillFromArray(int... evs)
evs
- The new ev valuespublic void gainEV(EVYields evYields)
evYields
- The amount of EVs gained.public void writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
nbt
- The NBT tag to write to.public void readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
nbt
- The NBT tag to read from.public void writeToByteBuffer(io.netty.buffer.ByteBuf buf)
buf
- The byte bufferpublic EVStore readFromByteBuffer(io.netty.buffer.ByteBuf buf)
buf
- The byte bufferpublic int[] getArray()
public EVStore cloneEVs()
public void doubleValues()
public boolean berryEVs(BattleStatsType stat)
stat
- The stat to lower EVs in.public boolean vitaminEVs(BattleStatsType stat)
stat
- The stat to raise EVs in.public boolean wingEVs(BattleStatsType stat)
stat
- The stat to raise EVs in.public boolean addEVsOfType(BattleStatsType stat, int evIncrease, int maxValue)
stat
- The stat to raise EVs in.evIncrease
- The amount to increase bymaxValue
- The max value before it can't increasepublic void randomizeMaxEVs()