class CellIndex {
  static public function adjCells():Array< CellIndex > {
    var ret:Array< CellIndex > = new Array< CellIndex >();
    ret.push( new CellIndex(  1,  0,  0 ) );
    ret.push( new CellIndex(  1, -1,  0 ) );
    ret.push( new CellIndex(  0, -1,  0 ) );
    ret.push( new CellIndex( -1, -1,  0 ) );
    ret.push( new CellIndex(  1,  1, -1 ) );
    ret.push( new CellIndex(  0,  1, -1 ) );
    ret.push( new CellIndex( -1,  1, -1 ) );
    ret.push( new CellIndex(  1,  0, -1 ) );
    ret.push( new CellIndex(  0,  0, -1 ) );
    ret.push( new CellIndex( -1,  0, -1 ) );
    ret.push( new CellIndex(  1, -1, -1 ) );
    ret.push( new CellIndex(  0, -1, -1 ) );
    ret.push( new CellIndex( -1, -1, -1 ) );
    return( ret );
  }

  // ################################################################

  public var i:Int;
  public var j:Int;
  public var k:Int;
  public function new( ?ci:Int = 0,
                       ?cj:Int = 0,
                       ?ck:Int = 0 ) {
    i = ci;
    j = cj;
    k = ck;
  }
  public function clone():CellIndex {
    return( new CellIndex( i, j, k ) );
  }
}
