Added GtsRecordBase.Pokemon property.

This commit is contained in:
Greg Edwards 2015-04-21 20:35:19 -04:00
parent 7ab18824f6
commit 1900c5fa45
3 changed files with 50 additions and 0 deletions

View File

@ -71,13 +71,35 @@ namespace PkmnFoundations.Structures
}
set
{
if (value == null)
{
m_data = null;
m_data_readonly = null;
m_pokemon = null;
return;
}
if (value.Length != 0xEC) throw new ArgumentException("PKM length is incorrect");
m_data = value;
m_data_readonly = new ReadOnlyCollection<byte>(m_data);
m_pokemon = null;
}
}
private byte[] m_data;
private ReadOnlyCollection<byte> m_data_readonly;
private PokemonParty4 m_pokemon;
public override PokemonPartyBase Pokemon
{
get
{
if (DataActual == null || m_pokedex == null)
return null;
if (m_pokemon == null)
m_pokemon = new PokemonParty4(m_pokedex, DataActual);
return m_pokemon;
}
}
public byte Unknown1;
public byte Unknown2;

View File

@ -71,13 +71,36 @@ namespace PkmnFoundations.Structures
}
set
{
if (value == null)
{
m_data = null;
m_data_readonly = null;
//m_pokemon = null;
return;
}
if (value.Length != 0xEC) throw new ArgumentException("PKM length is incorrect");
m_data = value;
m_data_readonly = new ReadOnlyCollection<byte>(m_data);
//m_pokemon = null;
}
}
private byte[] m_data;
private ReadOnlyCollection<byte> m_data_readonly;
//private PokemonParty5 m_pokemon;
public override PokemonPartyBase Pokemon
{
get
{
if (DataActual == null || m_pokedex == null)
return null;
throw new NotImplementedException();
//if (m_pokemon == null)
// m_pokemon = new PokemonParty4(m_pokedex, DataActual);
//return m_pokemon;
}
}
public byte Unknown1;
public byte Unknown2;

View File

@ -25,6 +25,11 @@ namespace PkmnFoundations.Structures
}
}
public abstract PokemonPartyBase Pokemon
{
get;
}
/// <summary>
/// National Dex species number
/// </summary>