public Base6Directions.Direction TransformDirection(Base6Directions.Direction baseDirection) { Base6Directions.Axis axis = Base6Directions.GetAxis(baseDirection); int num = (int)(baseDirection % Base6Directions.Direction.Left); switch (axis) { case Base6Directions.Axis.ForwardBackward: if (num != 1) { return(this.Forward); } return(Base6Directions.GetFlippedDirection(this.Forward)); case Base6Directions.Axis.LeftRight: if (num != 1) { return(this.Left); } return(Base6Directions.GetFlippedDirection(this.Left)); } if (num != 1) { return(this.Up); } return(Base6Directions.GetFlippedDirection(this.Up)); }
public MatrixI(Vector3I position, Base6Directions.Direction forward, Base6Directions.Direction up) { Translation = position; Right = Base6Directions.GetFlippedDirection(Base6Directions.GetLeft(up, forward)); Up = up; Backward = Base6Directions.GetFlippedDirection(forward); }
/// <summary> /// Returns the direction baseDirection will point to after transformation /// </summary> public Base6Directions.Direction TransformDirection(Base6Directions.Direction baseDirection) { Base6Directions.Axis axis = Base6Directions.GetAxis(baseDirection); int flip = ((int)baseDirection % 2); if (axis == Base6Directions.Axis.ForwardBackward) { return(flip == 1 ? Base6Directions.GetFlippedDirection(Forward) : Forward); } if (axis == Base6Directions.Axis.LeftRight) { return(flip == 1 ? Base6Directions.GetFlippedDirection(Left) : Left); } Debug.Assert(axis == Base6Directions.Axis.UpDown, "Axis invalid in MyBlockOrientation"); return(flip == 1 ? Base6Directions.GetFlippedDirection(Up) : Up); }