Package org.gbcpainter.game.model.grid

Examples of org.gbcpainter.game.model.grid.JunctionImpl


    assertTrue( pipe.isColored() );
  }

  @Test
  public void testJunctionColoring() throws Exception {
    Junction junction = new JunctionImpl( new Point( 0, 0 ), new HashSet<>(
        Arrays.asList( PERPENDICULAR_DIRECTION.LEFT, PERPENDICULAR_DIRECTION.RIGHT, PERPENDICULAR_DIRECTION.DOWN )
    ) );

    assertFalse( junction.isColored() );

    junction.setColored( true );
    assertTrue( junction.isColored() );


    junction.setColored( false );
    assertFalse( junction.isColored() );
  }
View Full Code Here


    assertEquals( pipe.getAvailableDirections(), new HashSet<>( Arrays.asList( PERPENDICULAR_DIRECTION.UP, PERPENDICULAR_DIRECTION.DOWN ) ) );
  }

  @Test
  public void junctionHitTest() throws Exception {
    Junction junction = new JunctionImpl( new Point( 0, 0 ), new HashSet<>(
        Arrays.asList( PERPENDICULAR_DIRECTION.LEFT, PERPENDICULAR_DIRECTION.RIGHT, PERPENDICULAR_DIRECTION.DOWN )
    ) );

    assertTrue( junction.contains( new Point( 0, 0 ) ) );

    assertFalse( junction.contains( new Point( 1, 0 ) ) );
    assertFalse( junction.contains( new Point( 0, 1 ) ) );

    assertEquals( junction.getAvailableDirections(), new HashSet<>( Arrays.asList( PERPENDICULAR_DIRECTION.LEFT, PERPENDICULAR_DIRECTION.RIGHT,
                                                                                   PERPENDICULAR_DIRECTION.DOWN ) ) );
  }
View Full Code Here

      }

    }

    try {
      return new JunctionImpl( position, directions );
    } catch ( Exception e ) {
      throw new IllegalArgumentException( e );
    }
  }
View Full Code Here

TOP

Related Classes of org.gbcpainter.game.model.grid.JunctionImpl

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.