package Organisms2.g4;

class BrickEntity extends NetEntity {
    public BrickEntity( int[] param, int key ) {
        super( param, key );
    }

    public int rank( int x, int y ) {
        if ( 0 == (y+40000)% 4 )
            return 1;
        if ( (y+40000)%8 > 4 )
        {
            if ( 0 == (x+40000)%4 )
                return 1;
        }
        else
        {
            if ( 2 == (x+40000)%4 )
                return 1;
        }

        return -1;
    }

    public int direction( int x, int y ) {
        if ( 0 == (y+30000)%6 )
            return EAST;
        if ( 3 == (y+30000)%6 )
            return WEST;
        if ( (x+40000)%8 >= 4 )
            return NORTH;
        return SOUTH;
    }
}
