Package javaEffect.characters

Examples of javaEffect.characters.Character


    ArrayList<Character> list = new ArrayList<Character>();

    for (Element character : node.getChildren("character")) {

      Character npg = null;

      if (!Character.isInList(character.getAttributeValue("firstName"),
          character.getAttributeValue("lastName"))) {

        if (character.getAttributeValue("race").equalsIgnoreCase(
            "Human")) {
          npg = new Human(character.getAttributeValue("firstName"),
              character.getAttributeValue("lastName"));
        } else if (character.getAttributeValue("race")
            .equalsIgnoreCase("Asari")) {
          npg = new Asari(character.getAttributeValue("firstName"),
              character.getAttributeValue("lastName"));
        } else if (character.getAttributeValue("race")
            .equalsIgnoreCase("Krogan")) {
          npg = new Krogan(character.getAttributeValue("firstName"),
              character.getAttributeValue("lastName"));
        } else {
          throw new ErrNotFountOrMistake("The race of the character "
              + character.getAttributeValue("firstName") + " "
              + character.getAttributeValue("lastName")
              + " is undefined or misdefined in the xml file.");
        }

        if (npg != null) {
          try {
            Planet.getPlanet(character.getAttributeValue("planet"))
                .addCharacter(npg);
          } catch (DataFormatException e) {
            e.printStackTrace();
          }
        }

      } else {

        if (Character
            .getCharacter(character.getAttributeValue("firstName"),
                character.getAttributeValue("lastName"))
            .getRace()
            .equalsIgnoreCase(character.getAttributeValue("race"))) {
          npg = Character.getCharacter(
              character.getAttributeValue("firstName"),
              character.getAttributeValue("lastName"));
        } else {
          throw new ErrNotFountOrMistake("The race " +  character.getAttributeValue("race") + " of the character "
              + character.getAttributeValue("firstName") + " "
              + character.getAttributeValue("lastName")
              + " is undefined or misdefined in the xml file.");
        }

      }

      for(Element text : character.getChildren("text")){
        npg.setText(text.getText());
      }
     
      list.add(npg);
    }
    return list;
View Full Code Here


  }

  public Character startMission(int id) throws ErrNotFountOrMistake {

    boolean isPresent = false;
    Character target = null;

    Element root = document.getRootElement();
    for (Element node : root.getChildren("mission")) {

      if (node.getAttributeValue("id").equals(id + "")) {
View Full Code Here

TOP

Related Classes of javaEffect.characters.Character

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.