Package org.pokenet.server.battle.mechanics

Examples of org.pokenet.server.battle.mechanics.ModData


  /**
   * Load a team from a file and return the ModData used by the team.
   */
  public static ModData loadTeam(File f, Pokemon[] team) {
    ModData modData = null;

    try {
      FileInputStream file = new FileInputStream(f);
      ObjectInputStream obj = new ObjectInputStream(file);
      // First thing in file is a UUID identifying the server.
      String uuid = (String) obj.readObject();
      modData = ModData.getModData(uuid);
      if (modData == null) {
        modData = ModData.getDefaultData();
      }
      Pokemon[] pokemon = null;
      synchronized (PokemonSpecies.class) {
        PokemonSpeciesData data = PokemonSpecies.getDefaultData();
        PokemonSpecies.setDefaultData(modData.getSpeciesData());
        try {
          pokemon = (Pokemon[]) obj.readObject();
        } finally {
          PokemonSpecies.setDefaultData(data);
        }
View Full Code Here


   public void validateTeam(Pokemon[] team, int idx) throws ValidationException {
     final int length = team.length;
     if ((length < 1) || (length > 6)) {
       throw new ValidationException("The team is an invalid size.");
     }
     ModData data = ModData.getDefaultData();
     for (int i = 0; i < length; ++i) {
       team[i].validate(data);
     }

     // Check any clauses.
View Full Code Here

TOP

Related Classes of org.pokenet.server.battle.mechanics.ModData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.