Examples of Pilot


Examples of megamek.common.Pilot

        out.write("\" jumpMp=\"");
        out.write(String.valueOf(entity.getOriginalJumpMP()));
        out.write("\">");

        // Add the crew this entity.
        final Pilot crew = entity.getCrew();
        out.write("<pilot name=\"");
        out.write(crew.getName());
        out.write("\" gunnery=\"");
        out.write(String.valueOf(crew.getGunnery()));
        out.write("\" piloting=\"");
        out.write(String.valueOf(crew.getPiloting()));
        if (crew.isDead() || (crew.getHits() > 5)) {
            out.write("\" hits=\"Dead");
        } else if (crew.getHits() > 0) {
            out.write("\" hits=\"");
            out.write(String.valueOf(crew.getHits()));
        }
        if (crew.countAdvantages() > 0) {
            out.write("\" advantages=\"");
            out.write(String.valueOf(crew.getAdvantageList(" ")));
        }
        if (crew.countMDImplants() > 0) {
            out.write("\" implants=\"");
            out.write(String.valueOf(crew.getImplantList(" ")));
        }
        out.write("\"/>");

        // Write the game-specific data.
        out.write("<entityData gameId=\"");
View Full Code Here

Examples of megamek.common.Pilot

            }
            System.out.println("Loading " + ms.getName());
            Entity e = new MechFileParser(ms.getSourceFile(), ms.getEntryName())
                    .getEntity();
            e
                    .setCrew(new Pilot(st.nextToken(), Integer.parseInt(st
                            .nextToken()), Integer.parseInt(st.nextToken())));
            try {
                String direction = st.nextToken();
                if (direction.equalsIgnoreCase("N")) {
                    e.setFacing(0);
View Full Code Here

Examples of megamek.common.Pilot

     * @param damage
     *            The <code>int</code> amount of damage.
     */
    private Vector<Report> damageCrew(Entity en, int damage) {
        Vector<Report> vDesc = new Vector<Report>();
        Pilot crew = en.getCrew();
        if (!crew.isDead() && !crew.isEjected() && !crew.isDoomed()) {
            crew.setHits(crew.getHits() + damage);
            Report r = new Report(6025);
            r.subject = en.getId();
            r.indent(2);
            r.addDesc(en);
            r.add(crew.getName());
            r.add(damage);
            r.newlines = 0;
            vDesc.addElement(r);
            if (Pilot.DEATH > crew.getHits()) {
                vDesc.addAll(resolveCrewDamage(en, damage));
            } else if (!crew.isDoomed()) {
                crew.setDoomed(true);
                vDesc.addAll(destroyEntity(en, "pilot death", true));
            }
        }
        return vDesc;
    }
View Full Code Here

Examples of megamek.common.Pilot

                entity.setOffBoard(0, Entity.NONE);
            }

            // change entity
            if (client.game.getOptions().booleanOption("rpg_gunnery")) {
                entity.setCrew(new Pilot(name, gunneryL, gunneryM, gunneryB,
                        piloting));
            } else {
                entity.setCrew(new Pilot(name, gunnery, piloting));
            }
            entity.getCrew().setInitBonus(init);
            entity.getCrew().setCommandBonus(command);
            if (entity instanceof Mech) {
                Mech mech = (Mech) entity;
View Full Code Here

Examples of megamek.common.Pilot

                entity.setOffBoard(0, Entity.NONE);
            }

            // change entity
            if (client.game.getOptions().booleanOption("rpg_gunnery")) {
                entity.setCrew(new Pilot(name, gunneryL, gunneryM, gunneryB,
                        piloting));
            } else {
                entity.setCrew(new Pilot(name, gunnery, piloting));
            }
            entity.getCrew().setInitBonus(init);
            entity.getCrew().setCommandBonus(command);
            if (entity instanceof Mech) {
                Mech mech = (Mech) entity;
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

*
*/
public class QueryExample {
  private static void listResult(ObjectSet result) {
    for (Iterator it = result.iterator(); it.hasNext();) {
      Pilot pilot = (Pilot) it.next();
      System.out.println(pilot.toString());
    }
  }
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

      System.out.println(pilot.toString());
    }
  }

  public static void storeFirstPilot(ObjectContainer db) {
    Pilot pilot1 = new Pilot("Michael Schumacher", 100);
    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }

  public static void storeSecondPilot(ObjectContainer db) {
    Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
    db.set(pilot2);
    System.out.println("Stored " + pilot2);
  }
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

    ObjectSet result = query.execute();
    listResult(result);
  }

  public static void retrieveByDefaultFieldValue(ObjectContainer db) {
    Pilot somebody = new Pilot("Somebody else", 0);
    db.set(somebody);
    Query query = db.query();
    query.constrain(Pilot.class);
    query.descend("points").constrain(new Integer(0));
    ObjectSet result = query.execute();
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

    result = query.execute();
    listResult(result);
  }

  public static void clearDatabase(ObjectContainer db) {
    ObjectSet result = db.get(new Pilot(null, 0));
    while (result.hasNext()) {
      db.delete(result.next());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.