C# Class Cyjb.Projects.JigsawGame.Shape.JigsawShape

拼图形状的抽象基类。
Exibir arquivo Open project: CYJB/Cyjb.Projects.JigsawGame Class Usage Examples

Public Methods

Method Description
CreateShape ( JigsawShapeType type ) : JigsawShape

创建指定类型的拼图形状。

GererateJigsawShape ( ) : void

生成拼图形状。

Protected Methods

Method Description
AddBorder ( Path path, Vector2 startPoint, Vector2 endPoint, bool border, float randoms ) : void

向拼图碎片的路径中添加一条边,路径的当前节点总是在起始点。

JigsawShape ( int randomCnt ) : System.Collections.Generic

创建一个新的拼图划分器。

Private Methods

Method Description
GenerateRandom ( ) : float[]

生成指定个数的随机数。

JigsawShape ( ) : System.Collections.Generic

创建一个新的拼图划分器。

Method Details

AddBorder() protected method

向拼图碎片的路径中添加一条边,路径的当前节点总是在起始点。
protected AddBorder ( Path path, Vector2 startPoint, Vector2 endPoint, bool border, float randoms ) : void
path Path 路径。
startPoint Vector2 边的起始点。
endPoint Vector2 边的结束点。
border bool 与该条边相关的一组随机数,范围都是 [0, 1)。
randoms float 该边的凹凸性。
return void

CreateShape() public static method

创建指定类型的拼图形状。
public static CreateShape ( JigsawShapeType type ) : JigsawShape
type JigsawShapeType 拼图形状的类型。
return JigsawShape

GererateJigsawShape() public method

生成拼图形状。
public GererateJigsawShape ( ) : void
return void

JigsawShape() protected method

创建一个新的拼图划分器。
protected JigsawShape ( int randomCnt ) : System.Collections.Generic
randomCnt int 生成边时需要的随机数个数。
return System.Collections.Generic