jfreerails.world.track
Class EightRotationsOfTrackPieceProducer

java.lang.Object
  extended by jfreerails.world.track.EightRotationsOfTrackPieceProducer

public class EightRotationsOfTrackPieceProducer
extends java.lang.Object

This class provides a method to get the eight rotations of a track template. E.g. if the teamplate is: 010 010 110 it returns: 010 001 100 010 110 111 110 100 000 etc.

Version:
1.0
Author:
Luke Lindsay

Constructor Summary
EightRotationsOfTrackPieceProducer()
           
 
Method Summary
static int[] getRotations(int trackBlueprint)
          The method that returns the rotations.
private static boolean[][] getTrackBooleanArray(int trackGraphicInt)
           
private static int getTrackGraphicID(boolean[][] railsList)
           
private static boolean[][] rotateTrackNodeClockwise(boolean[][] source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EightRotationsOfTrackPieceProducer

public EightRotationsOfTrackPieceProducer()
Method Detail

getRotations

public static int[] getRotations(int trackBlueprint)
The method that returns the rotations.

Parameters:
trackBlueprint - A 9bit value that serves as the template.
Returns:
An array of 8 9-bit values that have been generated by rotating the template.

getTrackBooleanArray

private static boolean[][] getTrackBooleanArray(int trackGraphicInt)

getTrackGraphicID

private static int getTrackGraphicID(boolean[][] railsList)

rotateTrackNodeClockwise

private static boolean[][] rotateTrackNodeClockwise(boolean[][] source)