Package org.gnubridge.presentation.gui

Source Code of org.gnubridge.presentation.gui.HumanAlwaysOnBottom

package org.gnubridge.presentation.gui;

import org.gnubridge.core.Direction;
import org.gnubridge.core.South;

public class HumanAlwaysOnBottom {

  private Direction humanBase;

  public HumanAlwaysOnBottom(Direction human) {
    humanBase = human;
  }

  public Direction mapRelativeTo(Direction d) {
    Direction rotation = South.i();
    Direction slot = South.i();

    while (!rotation.equals(d)) {
      slot = slot.clockwise();
      rotation = rotation.clockwise();
    }

    Direction humanOffset = humanBase;
    while (!humanOffset.equals(South.i())) {
      slot = slot.clockwise();
      humanOffset = humanOffset.clockwise();
    }
    return slot;
  }

}
TOP

Related Classes of org.gnubridge.presentation.gui.HumanAlwaysOnBottom

TOP
Copyright © 2018 www.massapi.com. 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.