Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public Face(Direction direction, Color color)
 {
     Index = direction.Index;
      Name = direction.Name;
      Initial = direction.Initial;
      CenterPoint = Locations.Origin + direction.Normal * Cubie.Length * 1.5;
      Direction = direction;
      Color = color;
 }
Пример #2
0
 static Directions()
 {
     _all = new List<Direction>();
      All = _all;
      Up = NewDirectionInfo("Up", new Vector3D(0, 1, 0));
      Down = NewDirectionInfo("Down", new Vector3D(0, -1, 0));
      Front = NewDirectionInfo("Front", new Vector3D(0, 0, -1));
      Back = NewDirectionInfo("Back", new Vector3D(0, 0, 1));
      Right = NewDirectionInfo("Right", new Vector3D(1, 0, 0));
      Left = NewDirectionInfo("Left", new Vector3D(-1, 0, 0));
 }
Пример #3
0
 public string Format(Direction direction)
 {
     return String.Format(_format, direction.Initial);
 }
Пример #4
0
 private static Face NewFace(Direction direction, Color color)
 {
     var face = new Face(direction, color);
      _all.Add(face);
      return face;
 }
Пример #5
0
 private Direction RotateHelper(Direction direction, Angle angle)
 {
     var transform = TransformCalculator.GetRotationTransform(direction.Normal, angle.Degrees);
      var newNormal = transform.Transform(Normal);
      return Directions.GetDirection(newNormal);
 }
Пример #6
0
 private Direction CrossProductHelper(Direction direction)
 {
     var newNormal = Normal.Cross(direction.Normal);
      return Directions.GetDirection(newNormal);
 }
Пример #7
0
 public Direction Rotate(Direction direction, Angle angle)
 {
     return _rotations.Get(direction, angle);
 }
Пример #8
0
 public Direction CrossProduct(Direction direction)
 {
     return _crossProducts.Get(direction);
 }
Пример #9
0
 private Location RotateHelper(Direction direction, Angle angle)
 {
     var transform = TransformCalculator.GetRotationTransform(direction.Normal, angle.Degrees);
      var newPoint = transform.Transform(Point);
      return Locations.GetLocation(newPoint);
 }
Пример #10
0
 private static Direction NewDirectionInfo(string name, Vector3D normal)
 {
     var directionInfo = new Direction(_all.Count, name, normal);
      _all.Add(directionInfo);
      return directionInfo;
 }