setEdgeDepths method

void setEdgeDepths(
  1. int position,
  2. int depth
)

Implementation

void setEdgeDepths(int position, int depth) {
  int depthDelta = getEdge().getDepthDelta();
  if (!isForward) depthDelta = -depthDelta;

  int directionFactor = 1;
  if (position == Position.left) directionFactor = -1;

  int oppositePos = Position.opposite(position);
  int delta = depthDelta * directionFactor;
  int oppositeDepth = depth + delta;
  setDepth(position, depth);
  setDepth(oppositePos, oppositeDepth);
}