示例#1
0
 static Locations()
 {
     _all = new List<Location>();
      Origin = new Point3D();
      All = _all;
      Up = NewLocation(Directions.Up);
      UpFrontRight = NewLocation(Directions.Up, Directions.Front, Directions.Right);
      UpFront = NewLocation(Directions.Up, Directions.Front);
      UpFrontLeft = NewLocation(Directions.Up, Directions.Front, Directions.Left);
      UpRight = NewLocation(Directions.Up, Directions.Right);
      UpBackRight = NewLocation(Directions.Up, Directions.Back, Directions.Right);
      UpBack = NewLocation(Directions.Up, Directions.Back);
      UpBackLeft = NewLocation(Directions.Up, Directions.Back, Directions.Left);
      UpLeft = NewLocation(Directions.Up, Directions.Left);
      Down = NewLocation(Directions.Down);
      DownFrontRight = NewLocation(Directions.Down, Directions.Front, Directions.Right);
      DownFront = NewLocation(Directions.Down, Directions.Front);
      DownFrontLeft = NewLocation(Directions.Down, Directions.Front, Directions.Left);
      DownRight = NewLocation(Directions.Down, Directions.Right);
      DownBackRight = NewLocation(Directions.Down, Directions.Back, Directions.Right);
      DownBack = NewLocation(Directions.Down, Directions.Back);
      DownBackLeft = NewLocation(Directions.Down, Directions.Back, Directions.Left);
      DownLeft = NewLocation(Directions.Down, Directions.Left);
      FrontRight = NewLocation(Directions.Front, Directions.Right);
      Front = NewLocation(Directions.Front);
      FrontLeft = NewLocation(Directions.Front, Directions.Left);
      BackRight = NewLocation(Directions.Back, Directions.Right);
      Back = NewLocation(Directions.Back);
      BackLeft = NewLocation(Directions.Back, Directions.Left);
      Right = NewLocation(Directions.Right);
      Left = NewLocation(Directions.Left);
 }
示例#2
0
 private static Location NewLocation(params Direction[] directions)
 {
     var location = new Location(_all.Count, directions);
      _all.Add(location);
      // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
      _all.Single(l => l.Point.IsSame(location.Point));
      return location;
 }