当前位置: 首页>>代码示例>>C#>>正文


C# Point.RelativeOrientationTo方法代码示例

本文整理汇总了C#中Point.RelativeOrientationTo方法的典型用法代码示例。如果您正苦于以下问题:C# Point.RelativeOrientationTo方法的具体用法?C# Point.RelativeOrientationTo怎么用?C# Point.RelativeOrientationTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point的用法示例。


在下文中一共展示了Point.RelativeOrientationTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PutTwoWayChunk

 Chunk PutTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
 {
     Chunk chunk = null;
     if ((((int)parentPoint.RelativeOrientationTo(currentPoint) -
           (int)otherPoint.RelativeOrientationTo(currentPoint)) % 2) == 0) {
         chunk = PutSraightTwoWayChunk(currentPoint, parentPoint, otherPoint, chamberProbability);
     } else {
         chunk = PutCornerTwoWayChunk(currentPoint, parentPoint, otherPoint, chamberProbability);
     }
     return chunk;
 }
开发者ID:tditada,项目名称:Dungeon-Crawler,代码行数:11,代码来源:MapGenerator.cs

示例2: PutThreeWayChunk

 Chunk PutThreeWayChunk(Point currentPoint, Point parentPoint, Point otherPoint1, Point otherPoint2, double chamberProbability)
 {
     Chunk chunk = InstantiateChunk(threeWayCorridorPrefab, threeWayChamberPrefab, chamberProbability, currentPoint);
     var orientationSum = (int)parentPoint.RelativeOrientationTo(currentPoint) +
         (int)otherPoint1.RelativeOrientationTo(currentPoint) + (int)otherPoint2.RelativeOrientationTo(currentPoint);
     if (orientationSum % 2 == 0) {
         if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH ||
             otherPoint1.RelativeOrientationTo(currentPoint) == Orientation.NORTH ||
             otherPoint2.RelativeOrientationTo(currentPoint) == Orientation.NORTH) {
             chunk.Rotate(Orientation.NORTH);
         } else {
             chunk.Rotate(Orientation.SOUTH);
         }
     } else {
         if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST ||
             otherPoint1.RelativeOrientationTo(currentPoint) == Orientation.EAST ||
             otherPoint2.RelativeOrientationTo(currentPoint) == Orientation.EAST) {
             chunk.Rotate(Orientation.EAST);
         } else {
             chunk.Rotate(Orientation.WEST);
         }
     }
     Debug.Log ("Putting ThreeWayChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
     return chunk;
 }
开发者ID:tditada,项目名称:Dungeon-Crawler,代码行数:25,代码来源:MapGenerator.cs

示例3: PutCornerTwoWayChunk

 Chunk PutCornerTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
 {
     Chunk chunk = InstantiateChunk(cornerPrefab, cornerChamberPrefab, chamberProbability, currentPoint);
     if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH &&
          otherPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST) ||
         (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST &&
      otherPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH)) {
         chunk.Rotate(Orientation.NORTH);
     } else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST &&
                 otherPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH) ||
                (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH &&
      otherPoint.RelativeOrientationTo(currentPoint) == Orientation.EAST)) {
         chunk.Rotate(Orientation.EAST);
     } else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH &&
                 otherPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST) ||
                (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST &&
      otherPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH)) {
         chunk.Rotate(Orientation.SOUTH);
     } else if ((parentPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST &&
                 otherPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH) ||
                (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH &&
      otherPoint.RelativeOrientationTo(currentPoint) == Orientation.WEST)) {
         chunk.Rotate(Orientation.WEST);
     }
     Debug.Log ("Putting CornerChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
     return chunk;
 }
开发者ID:tditada,项目名称:Dungeon-Crawler,代码行数:27,代码来源:MapGenerator.cs

示例4: PutSraightTwoWayChunk

 Chunk PutSraightTwoWayChunk(Point currentPoint, Point parentPoint, Point otherPoint, double chamberProbability)
 {
     Chunk chunk = InstantiateChunk(twoWayCorridorPrefab, twoWayChamberPrefab, chamberProbability, currentPoint);
     if (parentPoint.RelativeOrientationTo(currentPoint) == Orientation.SOUTH ||
         parentPoint.RelativeOrientationTo(currentPoint) == Orientation.NORTH) {
         chunk.Rotate(Orientation.NORTH);
     } else {
         chunk.Rotate(Orientation.EAST);
     }
     Debug.Log ("Putting TwoWayChunk at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
     return chunk;
 }
开发者ID:tditada,项目名称:Dungeon-Crawler,代码行数:12,代码来源:MapGenerator.cs

示例5: PutChamber

 Chunk PutChamber(Point currentPoint, Point parentPoint)
 {
     var chunk = InstantiateChunk(chamberPrefab, chamberPrefab, chamberProbability, currentPoint);
     chunk.Rotate(parentPoint.RelativeOrientationTo(currentPoint));
     Debug.Log ("Putting Chamber at " + currentPoint + " with orientation towards " + chunk.chunkOrientation);
     return chunk;
 }
开发者ID:tditada,项目名称:Dungeon-Crawler,代码行数:7,代码来源:MapGenerator.cs


注:本文中的Point.RelativeOrientationTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。