Package com.oti

Examples of com.oti.Location


    //    System.out.println("SAM TO REMOVE createMove firstCel "+ firstCell+" otherCell "+ otherCell);
    //    System.out.println("SAM TO REMOVE createMove firstCellVal "+ firstCellVal+" otherCellVal "+ otherCellVal);
   
   
    Piece currPiece = null;
    Location  currLoc = null;
    if (firstCellVal==0) {
      currPiece = Piece.pieceForNumber(otherCellVal);
      currLoc = Location.locationFor(firstCell%4, firstCell/4, 4);
    } else {
      assert(otherCellVal==0);
View Full Code Here


    //    System.out.println("SAM TO REMOVE createMove firstCel "+ firstCell+" otherCell "+ otherCell);
    //    System.out.println("SAM TO REMOVE createMove firstCellVal "+ firstCellVal+" otherCellVal "+ otherCellVal);
   
   
    Piece currPiece = null;
    Location  currLoc = null;
    if (firstCellVal==0) {
      currPiece = Piece.pieceForNumber(otherCellVal);
      currLoc = Location.locationFor(firstCell%4, firstCell/4, 4);
    } else {
      assert(otherCellVal==0);
View Full Code Here

*/

public class TestState {
    @Test
    public void testState(){
        Location locOf7 = Location.locationFor(3,2, 4);
        Location otherLocOf7 = Location.locationFor(3, 2, 4);
        Location locOf10 = Location.locationFor(2,3, 4);

        Assert.assertThat(locOf7, is(locOf7));
        Assert.assertThat(locOf7, is(otherLocOf7));
        Assert.assertThat(locOf7, is(not(locOf10)));
        Assert.assertThat(locOf10, is(not(locOf7)));

        Assert.assertTrue(locOf7.compareTo(locOf10) < 0);
        Assert.assertTrue(locOf10.compareTo(locOf7) > 0);
        Assert.assertTrue(locOf7.compareTo(locOf7) == 0);
        Assert.assertTrue(locOf10.compareTo(locOf10) == 0);

    }
View Full Code Here

        Piece blank = Piece.pieceForNumber(0);
        Piece one = Piece.pieceForNumber(1);
        Piece otherOne = Piece.pieceForNumber(1);
        Piece two = Piece.pieceForNumber(2);

        Location locOfBlank = Location.locationFor(3,3, 4);
        Location otherLocOfBlank = Location.locationFor(3, 3, 4);
        Location locOfOne = Location.locationFor(0,0, 4);
        Location locOfTwo = Location.locationFor(1,0, 4);

        Assert.assertThat(locOfBlank, is(otherLocOfBlank));
        Assert.assertThat(locOfBlank, is(not(locOfOne)));
        Assert.assertThat(locOfBlank, is(not(locOfTwo)));
        Assert.assertThat(locOfOne, is(locOfOne));
        Assert.assertThat(locOfTwo, is(locOfTwo));
        Assert.assertThat(locOfTwo, is(not(locOfOne)));

        Assert.assertTrue(locOfBlank.compareTo(locOfBlank) == 0);
        Assert.assertTrue(locOfOne.compareTo(locOfOne) == 0);
        Assert.assertTrue(locOfTwo.compareTo(locOfTwo) == 0);

        Assert.assertTrue(locOfBlank.compareTo(locOfOne) > 0);
        Assert.assertTrue(locOfBlank.compareTo(locOfTwo) > 0);
        Assert.assertTrue(locOfOne.compareTo(locOfBlank) < 0);
        Assert.assertTrue(locOfTwo.compareTo(locOfBlank) < 0);

        Assert.assertTrue(locOfTwo.compareTo(locOfOne) > 0);
        Assert.assertTrue(locOfOne.compareTo(locOfTwo) < 0);


    }
View Full Code Here

TOP

Related Classes of com.oti.Location

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.