Examples of PieceDef


Examples of org.darkhelm.dragonchess.server.piece.PieceDef

      for (int horiz = 0; horiz < Boards.WIDTH; horiz++) {
        BoardPiece bPiece = this.get(vert, horiz);
        if (bPiece == null || bPiece.getTeam() != team) {
          continue;
        }
        PieceDef pDef = PieceDef.get(bPiece.getType());

        PieceMoveSet moves = pDef.getMoves(getType());

        long hash = Zobrist.getHash(getType(), team, horiz, vert,
            bPiece.getType());

        Piece piece = new Piece(hash, bPiece.getType(), team,
            pDef.getValue());

        if (getSet().isFrozen(getType(), horiz, vert)) {
          piece.addMove(new Move(getSet().hash(), 0, getType(),
              horiz, vert, MoveTypes.FREEZE));
        } else {
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

      for (int horiz = 0; horiz < Boards.WIDTH; horiz++) {
        BoardPiece bPiece = this.get(vert, horiz);
        if (bPiece == null || bPiece.getTeam() != team) {
          continue;
        }
        PieceDef pDef = PieceDef.get(bPiece.getType());

        PieceMoveSet moves = pDef.getMoves(getType());

        moveList.addAll(moves.getCheckMoves(team, this, horiz, vert));
      }
    }
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

          continue;
        }

        Teams team = bPiece.getTeam();

        PieceDef pDef = PieceDef.get(bPiece.getType());

        PieceMoveSet moves = pDef.getMoves(getType());

        freezeList.addAll(moves.getFrozenLocations(team, this, horiz,
            vert));
      }
    }
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

          "http://dragonchess.darkhelm.org/xml/pieces/basilisk.xml");

      IBindingFactory bfact = BindingDirectory.getFactory(PieceDef.class);

      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      PieceDef piece = (PieceDef) uctx.unmarshalDocument(new BufferedReader(
          new InputStreamReader(basiliskFile.openStream())), null);

      PrintWriter out = resp.getWriter();

      resp.setContentType("text/plain");
      out.println(piece.getName());

    } catch (JiBXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

public class PieceTest {
  @Test
  public void testBasilisk() {
    try {
      PieceDef piece = loadPiece("basilisk.xml");

      assertTrue(piece.getName() == Pieces.BASILISK);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

  }

  @Test
  public void testCleric() {
    try {
      PieceDef piece = loadPiece("cleric.xml");

      assertTrue(piece.getName() == Pieces.CLERIC);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

  }

  @Test
  public void testDragon() {
    try {
      PieceDef piece = loadPiece("dragon.xml");

      assertTrue(piece.getName() == Pieces.DRAGON);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

  }

  @Test
  public void testDwarf() {
    try {
      PieceDef piece = loadPiece("dwarf.xml");

      assertTrue(piece.getName() == Pieces.DWARF);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

  }

  @Test
  public void testElemental() {
    try {
      PieceDef piece = loadPiece("elemental.xml");

      assertTrue(piece.getName() == Pieces.ELEMENTAL);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
View Full Code Here

Examples of org.darkhelm.dragonchess.server.piece.PieceDef

  }

  @Test
  public void testGriffin() {
    try {
      PieceDef piece = loadPiece("griffin.xml");

      assertTrue(piece.getName() == Pieces.GRIFFIN);

    } catch (JiBXException e) {
      fail(e.getMessage());
      e.printStackTrace();
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.