Removed unnecessary Windows DB call for Pet Factory.
This commit is contained in:
parent
521891f409
commit
14da350b16
@ -42,49 +42,11 @@ public class PetFactory
|
||||
_pets.put(EntityType.OCELOT, new Pet("Cat", EntityType.OCELOT, 6000));
|
||||
_pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000));
|
||||
_pets.put(EntityType.WITHER, new Pet("Widder", EntityType.WITHER, -1));
|
||||
|
||||
List<PetSalesToken> petTokens = new ArrayList<PetSalesToken>();
|
||||
|
||||
for (Pet pet : _pets.values())
|
||||
{
|
||||
PetSalesToken petToken = new PetSalesToken();
|
||||
petToken.Name = pet.GetPetName();
|
||||
petToken.PetType = pet.GetPetType().toString();
|
||||
|
||||
petTokens.add(petToken);
|
||||
}
|
||||
|
||||
for (PetSalesToken petToken : _repository.GetPets(petTokens))
|
||||
{
|
||||
if (_pets.containsKey(EntityType.valueOf(petToken.PetType)))
|
||||
{
|
||||
_pets.get(EntityType.valueOf(petToken.PetType)).Update(petToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreatePetExtras()
|
||||
{
|
||||
_petExtras.put(Material.SIGN, new PetExtra("Name Tag", Material.NAME_TAG, 100));
|
||||
|
||||
List<PetExtraToken> petExtraTokens = new ArrayList<PetExtraToken>();
|
||||
|
||||
for (PetExtra petExtra : _petExtras.values())
|
||||
{
|
||||
PetExtraToken petToken = new PetExtraToken();
|
||||
petToken.Name = petExtra.GetName();
|
||||
petToken.Material = petExtra.GetMaterial().toString();
|
||||
|
||||
petExtraTokens.add(petToken);
|
||||
}
|
||||
|
||||
for (PetExtraToken token : _repository.GetPetExtras(petExtraTokens))
|
||||
{
|
||||
if (_petExtras.containsKey(Material.valueOf(token.Material)))
|
||||
{
|
||||
_petExtras.get(Material.valueOf(token.Material)).Update(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<Pet> GetPets()
|
||||
|
Loading…
Reference in New Issue
Block a user