Clear array passed to PokemonParty to assert dominance and take ownership of it.
This commit is contained in:
parent
8a7872cf3a
commit
b1f134c2a1
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using PkmnLibSharp.Utilities;
|
using PkmnLibSharp.Utilities;
|
||||||
|
|
||||||
namespace PkmnLibSharp.Battling
|
namespace PkmnLibSharp.Battling
|
||||||
|
@ -14,9 +15,12 @@ namespace PkmnLibSharp.Battling
|
||||||
public PokemonParty(byte size = 6) : base(Creaturelib.Generated.CreatureParty.ConstructWithSize(size))
|
public PokemonParty(byte size = 6) : base(Creaturelib.Generated.CreatureParty.ConstructWithSize(size))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public PokemonParty(Pokemon[] pokemon) : base(
|
public PokemonParty(Pokemon?[] pokemon) : base(
|
||||||
Creaturelib.Generated.CreatureParty.ConstructFromArray(pokemon.ArrayPtr(), (ulong) pokemon.Length))
|
Creaturelib.Generated.CreatureParty.ConstructFromArray(pokemon.ArrayPtr(), (ulong) pokemon.Length))
|
||||||
{}
|
{
|
||||||
|
for (var index = 0; index < pokemon.Length; index++)
|
||||||
|
pokemon[index] = null;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual Pokemon this[int i] => GetAtIndex((ulong) i);
|
public virtual Pokemon this[int i] => GetAtIndex((ulong) i);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue