docs: 优化 README.md 导航中无法跳转结构体的情况

This commit is contained in:
kercylan98
2024-01-15 10:41:10 +08:00
parent bd7a3fee6b
commit e7e679ea86
51 changed files with 480 additions and 240 deletions

View File

@@ -28,9 +28,9 @@ AOI 问题是在大规模多人在线游戏中常见的问题,它涉及到确
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[TwoDimensional](#twodimensional)|暂无描述...
|`INTERFACE`|[TwoDimensionalEntity](#twodimensionalentity)|基于2D定义的AOI对象功能接口
|`STRUCT`|[EntityJoinVisionEventHandle](#entityjoinvisioneventhandle)|暂无描述...
|`STRUCT`|[TwoDimensional](#struct_TwoDimensional)|暂无描述...
|`INTERFACE`|[TwoDimensionalEntity](#struct_TwoDimensionalEntity)|基于2D定义的AOI对象功能接口
|`STRUCT`|[EntityJoinVisionEventHandle](#struct_EntityJoinVisionEventHandle)|暂无描述...
</details>
@@ -65,6 +65,7 @@ func TestNewTwoDimensional(t *testing.T) {
***
<span id="struct_TwoDimensional"></span>
### TwoDimensional `STRUCT`
```go
@@ -82,6 +83,7 @@ type TwoDimensional[EID generic.Basic, PosType generic.SignedNumber, E TwoDimens
repartitionQueue []func()
}
```
<span id="struct_TwoDimensionalEntity"></span>
### TwoDimensionalEntity `INTERFACE`
基于2D定义的AOI对象功能接口
- AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等
@@ -92,6 +94,7 @@ type TwoDimensionalEntity[EID generic.Basic, PosType generic.SignedNumber] inter
GetPosition() geometry.Point[PosType]
}
```
<span id="struct_EntityJoinVisionEventHandle"></span>
### EntityJoinVisionEventHandle `STRUCT`
```go

View File

@@ -34,16 +34,16 @@ arrangement 包提供了一些有用的函数来处理数组的排列。
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Area](#area)|编排区域
|`STRUCT`|[AreaOption](#areaoption)|编排区域选项
|`STRUCT`|[AreaConstraintHandle](#areaconstrainthandle)|暂无描述...
|`STRUCT`|[Arrangement](#arrangement)|用于针对多条数据进行合理编排的数据结构
|`STRUCT`|[Editor](#editor)|提供了大量辅助函数的编辑器
|`INTERFACE`|[Item](#item)|编排成员
|`STRUCT`|[ItemOption](#itemoption)|编排成员选项
|`STRUCT`|[ItemFixedAreaHandle](#itemfixedareahandle)|暂无描述...
|`STRUCT`|[Option](#option)|编排选项
|`STRUCT`|[ConstraintHandle](#constrainthandle)|暂无描述...
|`STRUCT`|[Area](#struct_Area)|编排区域
|`STRUCT`|[AreaOption](#struct_AreaOption)|编排区域选项
|`STRUCT`|[AreaConstraintHandle](#struct_AreaConstraintHandle)|暂无描述...
|`STRUCT`|[Arrangement](#struct_Arrangement)|用于针对多条数据进行合理编排的数据结构
|`STRUCT`|[Editor](#struct_Editor)|提供了大量辅助函数的编辑器
|`INTERFACE`|[Item](#struct_Item)|编排成员
|`STRUCT`|[ItemOption](#struct_ItemOption)|编排成员选项
|`STRUCT`|[ItemFixedAreaHandle](#struct_ItemFixedAreaHandle)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|编排选项
|`STRUCT`|[ConstraintHandle](#struct_ConstraintHandle)|暂无描述...
</details>
@@ -115,6 +115,7 @@ arrangement 包提供了一些有用的函数来处理数组的排列。
> - 当所有的冲突处理函数都无法处理冲突时,将会进入下一个编排区域的尝试,如果均无法完成,将会将该成员加入到编排队列的末端,等待下一次编排
***
<span id="struct_Area"></span>
### Area `STRUCT`
编排区域
```go
@@ -126,16 +127,19 @@ type Area[ID comparable, AreaInfo any] struct {
evaluate AreaEvaluateHandle[ID, AreaInfo]
}
```
<span id="struct_AreaOption"></span>
### AreaOption `STRUCT`
编排区域选项
```go
type AreaOption[ID comparable, AreaInfo any] func(area *Area[ID, AreaInfo])
```
<span id="struct_AreaConstraintHandle"></span>
### AreaConstraintHandle `STRUCT`
```go
type AreaConstraintHandle[ID comparable, AreaInfo any] func(area *Area[ID, AreaInfo], item Item[ID]) error
```
<span id="struct_Arrangement"></span>
### Arrangement `STRUCT`
用于针对多条数据进行合理编排的数据结构
- 我不知道这个数据结构的具体用途,但是我觉得这个数据结构应该是有用的
@@ -153,6 +157,7 @@ type Arrangement[ID comparable, AreaInfo any] struct {
conflictHandles []ConflictHandle[ID, AreaInfo]
}
```
<span id="struct_Editor"></span>
### Editor `STRUCT`
提供了大量辅助函数的编辑器
```go
@@ -164,6 +169,7 @@ type Editor[ID comparable, AreaInfo any] struct {
retryCount int
}
```
<span id="struct_Item"></span>
### Item `INTERFACE`
编排成员
```go
@@ -172,21 +178,25 @@ type Item[ID comparable] interface {
Equal(item Item[ID]) bool
}
```
<span id="struct_ItemOption"></span>
### ItemOption `STRUCT`
编排成员选项
```go
type ItemOption[ID comparable, AreaInfo any] func(arrangement *Arrangement[ID, AreaInfo], item Item[ID])
```
<span id="struct_ItemFixedAreaHandle"></span>
### ItemFixedAreaHandle `STRUCT`
```go
type ItemFixedAreaHandle[AreaInfo any] func(areaInfo AreaInfo) bool
```
<span id="struct_Option"></span>
### Option `STRUCT`
编排选项
```go
type Option[ID comparable, AreaInfo any] func(arrangement *Arrangement[ID, AreaInfo])
```
<span id="struct_ConstraintHandle"></span>
### ConstraintHandle `STRUCT`
```go

View File

@@ -31,9 +31,9 @@ buffer 提供了缓冲区相关的实用程序。
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Ring](#ring)|环形缓冲区
|`STRUCT`|[RingUnbounded](#ringunbounded)|基于环形缓冲区实现的无界缓冲区
|`STRUCT`|[Unbounded](#unbounded)|是无界缓冲区的实现
|`STRUCT`|[Ring](#struct_Ring)|环形缓冲区
|`STRUCT`|[RingUnbounded](#struct_RingUnbounded)|基于环形缓冲区实现的无界缓冲区
|`STRUCT`|[Unbounded](#struct_Unbounded)|是无界缓冲区的实现
</details>
@@ -82,6 +82,7 @@ func TestNewRing(t *testing.T) {
> - 该缓冲区的所有方法都是线程安全的,除了用于同步的互斥锁外,不会阻塞任何东西
***
<span id="struct_Ring"></span>
### Ring `STRUCT`
环形缓冲区
```go
@@ -160,6 +161,7 @@ func BenchmarkRing_Write(b *testing.B) {
#### func (*Ring) Reset()
> 重置缓冲区
***
<span id="struct_RingUnbounded"></span>
### RingUnbounded `STRUCT`
基于环形缓冲区实现的无界缓冲区
```go
@@ -255,6 +257,7 @@ func TestRingUnbounded_Close(t *testing.T) {
***
<span id="struct_Unbounded"></span>
### Unbounded `STRUCT`
是无界缓冲区的实现
```go

View File

@@ -133,8 +133,8 @@ collection 用于对 input 和 map 操作的工具函数
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[ComparisonHandler](#comparisonhandler)|暂无描述...
|`STRUCT`|[OrderedValueGetter](#orderedvaluegetter)|暂无描述...
|`STRUCT`|[ComparisonHandler](#struct_ComparisonHandler)|暂无描述...
|`STRUCT`|[OrderedValueGetter](#struct_OrderedValueGetter)|暂无描述...
</details>
@@ -5411,11 +5411,13 @@ func TestShuffleByClone(t *testing.T) {
***
<span id="struct_ComparisonHandler"></span>
### ComparisonHandler `STRUCT`
```go
type ComparisonHandler[V any] func(source V) bool
```
<span id="struct_OrderedValueGetter"></span>
### OrderedValueGetter `STRUCT`
```go

View File

@@ -26,10 +26,10 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Matrix](#matrix)|暂无描述...
|`STRUCT`|[PagedSlice](#pagedslice)|是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。
|`STRUCT`|[PrioritySlice](#priorityslice)|是一个优先级切片
|`STRUCT`|[SyncSlice](#syncslice)|是基于 sync.RWMutex 实现的线程安全的 slice
|`STRUCT`|[Matrix](#struct_Matrix)|暂无描述...
|`STRUCT`|[PagedSlice](#struct_PagedSlice)|是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。
|`STRUCT`|[PrioritySlice](#struct_PrioritySlice)|是一个优先级切片
|`STRUCT`|[SyncSlice](#struct_SyncSlice)|是基于 sync.RWMutex 实现的线程安全的 slice
</details>
@@ -56,6 +56,7 @@
> 创建一个 SyncSlice
***
<span id="struct_Matrix"></span>
### Matrix `STRUCT`
```go
@@ -76,6 +77,7 @@ type Matrix[V any] struct {
#### func (*Matrix) Clear()
> 清空矩阵。
***
<span id="struct_PagedSlice"></span>
### PagedSlice `STRUCT`
是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。
```go
@@ -104,6 +106,7 @@ type PagedSlice[T any] struct {
#### func (*PagedSlice) Range(f func (index int, value T) bool)
> 迭代 PagedSlice 中的所有元素。
***
<span id="struct_PrioritySlice"></span>
### PrioritySlice `STRUCT`
是一个优先级切片
```go
@@ -181,6 +184,7 @@ func TestPrioritySlice_Append(t *testing.T) {
#### func (*PrioritySlice) String() string
> 返回切片字符串
***
<span id="struct_SyncSlice"></span>
### SyncSlice `STRUCT`
是基于 sync.RWMutex 实现的线程安全的 slice
```go

View File

@@ -23,7 +23,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[SyncMap](#syncmap)|是基于 sync.RWMutex 实现的线程安全的 map
|`STRUCT`|[SyncMap](#struct_SyncMap)|是基于 sync.RWMutex 实现的线程安全的 map
</details>
@@ -35,6 +35,7 @@
> 创建一个 SyncMap
***
<span id="struct_SyncMap"></span>
### SyncMap `STRUCT`
是基于 sync.RWMutex 实现的线程安全的 map
- 适用于要考虑并发读写但是并发读写的频率不高的情况

View File

@@ -52,13 +52,13 @@ combination 包提供了一些实用的组合函数。
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Combination](#combination)|用于从多个匹配器内提取组合的数据结构
|`STRUCT`|[Option](#option)|组合器选项
|`INTERFACE`|[Item](#item)|暂无描述...
|`STRUCT`|[Matcher](#matcher)|用于从一组数据内提取组合的数据结构
|`STRUCT`|[MatcherOption](#matcheroption)|匹配器选项
|`STRUCT`|[Validator](#validator)|用于对组合进行验证的校验器
|`STRUCT`|[ValidatorOption](#validatoroption)|暂无描述...
|`STRUCT`|[Combination](#struct_Combination)|用于从多个匹配器内提取组合的数据结构
|`STRUCT`|[Option](#struct_Option)|组合器选项
|`INTERFACE`|[Item](#struct_Item)|暂无描述...
|`STRUCT`|[Matcher](#struct_Matcher)|用于从一组数据内提取组合的数据结构
|`STRUCT`|[MatcherOption](#struct_MatcherOption)|匹配器选项
|`STRUCT`|[Validator](#struct_Validator)|用于对组合进行验证的校验器
|`STRUCT`|[ValidatorOption](#struct_ValidatorOption)|暂无描述...
</details>
@@ -241,6 +241,7 @@ combination 包提供了一些实用的组合函数。
> - getType: 用于获取组合中元素的类型,用于判断是否相同
***
<span id="struct_Combination"></span>
### Combination `STRUCT`
用于从多个匹配器内提取组合的数据结构
```go
@@ -304,16 +305,19 @@ func TestCombination_Best(t *testing.T) {
#### func (*Combination) Worst(items []T) (name string, result []T)
> 从一组数据中提取符合匹配器规则的最差组合
***
<span id="struct_Option"></span>
### Option `STRUCT`
组合器选项
```go
type Option[T Item] func(*Combination[T])
```
<span id="struct_Item"></span>
### Item `INTERFACE`
```go
type Item interface{}
```
<span id="struct_Matcher"></span>
### Matcher `STRUCT`
用于从一组数据内提取组合的数据结构
```go
@@ -335,11 +339,13 @@ type Matcher[T Item] struct {
#### func (*Matcher) Worst(items []T) []T
> 从一组数据中提取符筛选器规则的最差组合
***
<span id="struct_MatcherOption"></span>
### MatcherOption `STRUCT`
匹配器选项
```go
type MatcherOption[T Item] func(matcher *Matcher[T])
```
<span id="struct_Validator"></span>
### Validator `STRUCT`
用于对组合进行验证的校验器
```go
@@ -382,6 +388,7 @@ func TestValidator_Validate(t *testing.T) {
***
<span id="struct_ValidatorOption"></span>
### ValidatorOption `STRUCT`
```go

View File

@@ -24,9 +24,9 @@ deck 包中的内容用于针对一堆内容的管理,适用但不限于牌堆
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Deck](#deck)|甲板,用于针对一堆 Group 进行管理的数据结构
|`STRUCT`|[Group](#group)|甲板中的组,用于针对一堆内容进行管理的数据结构
|`INTERFACE`|[Item](#item)|甲板成员
|`STRUCT`|[Deck](#struct_Deck)|甲板,用于针对一堆 Group 进行管理的数据结构
|`STRUCT`|[Group](#struct_Group)|甲板中的组,用于针对一堆内容进行管理的数据结构
|`INTERFACE`|[Item](#struct_Item)|甲板成员
</details>
@@ -43,6 +43,7 @@ deck 包中的内容用于针对一堆内容的管理,适用但不限于牌堆
> 创建一个新的组
***
<span id="struct_Deck"></span>
### Deck `STRUCT`
甲板,用于针对一堆 Group 进行管理的数据结构
```go
@@ -72,6 +73,7 @@ type Deck[I Item] struct {
#### func (*Deck) GetPrev(guid int64) *Group[I]
> 获取特定组的上一个组
***
<span id="struct_Group"></span>
### Group `STRUCT`
甲板中的组,用于针对一堆内容进行管理的数据结构
```go
@@ -126,6 +128,7 @@ type Group[I Item] struct {
#### func (*Group) GetItem(index int) I
> 获取组中的指定内容
***
<span id="struct_Item"></span>
### Item `INTERFACE`
甲板成员
```go

View File

@@ -28,8 +28,8 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[FSM](#fsm)|状态机
|`STRUCT`|[Option](#option)|暂无描述...
|`STRUCT`|[FSM](#struct_FSM)|状态机
|`STRUCT`|[Option](#struct_Option)|暂无描述...
</details>
@@ -69,6 +69,7 @@
> - 该阶段状态机的状态为新的状态,而非退出前的状态
***
<span id="struct_FSM"></span>
### FSM `STRUCT`
状态机
```go
@@ -84,6 +85,7 @@ type FSM[State comparable, Data any] struct {
exitAfterEventHandles map[State][]func(state *FSM[State, Data])
}
```
<span id="struct_Option"></span>
### Option `STRUCT`
```go

View File

@@ -23,13 +23,13 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Comment](#comment)|暂无描述...
|`STRUCT`|[Field](#field)|暂无描述...
|`STRUCT`|[File](#file)|暂无描述...
|`STRUCT`|[Function](#function)|暂无描述...
|`STRUCT`|[Package](#package)|暂无描述...
|`STRUCT`|[Struct](#struct)|暂无描述...
|`STRUCT`|[Type](#type)|暂无描述...
|`STRUCT`|[Comment](#struct_Comment)|暂无描述...
|`STRUCT`|[Field](#struct_Field)|暂无描述...
|`STRUCT`|[File](#struct_File)|暂无描述...
|`STRUCT`|[Function](#struct_Function)|暂无描述...
|`STRUCT`|[Package](#struct_Package)|暂无描述...
|`STRUCT`|[Struct](#struct_Struct)|暂无描述...
|`STRUCT`|[Type](#struct_Type)|暂无描述...
</details>
@@ -60,6 +60,7 @@ func TestNewPackage(t *testing.T) {
***
<span id="struct_Comment"></span>
### Comment `STRUCT`
```go
@@ -68,6 +69,7 @@ type Comment struct {
Clear []string
}
```
<span id="struct_Field"></span>
### Field `STRUCT`
```go
@@ -78,6 +80,7 @@ type Field struct {
Comments *Comment
}
```
<span id="struct_File"></span>
### File `STRUCT`
```go
@@ -92,6 +95,7 @@ type File struct {
```
#### func (*File) Package() string
***
<span id="struct_Function"></span>
### Function `STRUCT`
```go
@@ -112,6 +116,7 @@ type Function struct {
```
#### func (*Function) Code() string
***
<span id="struct_Package"></span>
### Package `STRUCT`
```go
@@ -137,6 +142,7 @@ type Package struct {
***
#### func (*Package) GetBenchmarkTest(f *Function) *Function
***
<span id="struct_Struct"></span>
### Struct `STRUCT`
```go
@@ -151,6 +157,7 @@ type Struct struct {
Test bool
}
```
<span id="struct_Type"></span>
### Type `STRUCT`
```go

View File

@@ -23,7 +23,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Builder](#builder)|暂无描述...
|`STRUCT`|[Builder](#struct_Builder)|暂无描述...
</details>
@@ -34,6 +34,7 @@
<span id="New"></span>
***
<span id="struct_Builder"></span>
### Builder `STRUCT`
```go

View File

@@ -115,7 +115,7 @@ func (b *Builder) genMenus() {
structGen()
b.tableRow(
super.If(structInfo.Interface, "`INTERFACE`", "`STRUCT`"),
fmt.Sprintf("[%s](#%s)", structInfo.Name, strings.ToLower(structInfo.Name)),
fmt.Sprintf("[%s](#struct_%s)", structInfo.Name, structInfo.Name),
collection.FindFirstOrDefaultInSlice(structInfo.Comments.Clear, "暂无描述..."),
)
}
@@ -199,6 +199,7 @@ func (b *Builder) genStructs() {
continue
}
titleBuild()
b.newLine(fmt.Sprintf(`<span id="struct_%s"></span>`, structInfo.Name))
b.title(3, fmt.Sprintf("%s `%s`", structInfo.Name, super.If(structInfo.Interface, "INTERFACE", "STRUCT")))
b.newLine(structInfo.Comments.Clear...)
b.newLine("```go")

View File

@@ -27,21 +27,21 @@ generic 目的在于提供一组基于泛型的用于处理通用功能的函数
|类型|名称|描述
|:--|:--|:--
|`INTERFACE`|[IdR](#idr)|暂无描述...
|`INTERFACE`|[IDR](#idr)|暂无描述...
|`INTERFACE`|[IdW](#idw)|暂无描述...
|`INTERFACE`|[IDW](#idw)|暂无描述...
|`INTERFACE`|[IdR2W](#idr2w)|暂无描述...
|`INTERFACE`|[IDR2W](#idr2w)|暂无描述...
|`INTERFACE`|[Ordered](#ordered)|可排序类型
|`INTERFACE`|[Number](#number)|数字类型
|`INTERFACE`|[SignedNumber](#signednumber)|有符号数字类型
|`INTERFACE`|[Integer](#integer)|整数类型
|`INTERFACE`|[Signed](#signed)|有符号整数类型
|`INTERFACE`|[Unsigned](#unsigned)|无符号整数类型
|`INTERFACE`|[UnsignedNumber](#unsignednumber)|无符号数字类型
|`INTERFACE`|[Float](#float)|浮点类型
|`INTERFACE`|[Basic](#basic)|基本类型
|`INTERFACE`|[IdR](#struct_IdR)|暂无描述...
|`INTERFACE`|[IDR](#struct_IDR)|暂无描述...
|`INTERFACE`|[IdW](#struct_IdW)|暂无描述...
|`INTERFACE`|[IDW](#struct_IDW)|暂无描述...
|`INTERFACE`|[IdR2W](#struct_IdR2W)|暂无描述...
|`INTERFACE`|[IDR2W](#struct_IDR2W)|暂无描述...
|`INTERFACE`|[Ordered](#struct_Ordered)|可排序类型
|`INTERFACE`|[Number](#struct_Number)|数字类型
|`INTERFACE`|[SignedNumber](#struct_SignedNumber)|有符号数字类型
|`INTERFACE`|[Integer](#struct_Integer)|整数类型
|`INTERFACE`|[Signed](#struct_Signed)|有符号整数类型
|`INTERFACE`|[Unsigned](#struct_Unsigned)|无符号整数类型
|`INTERFACE`|[UnsignedNumber](#struct_UnsignedNumber)|无符号数字类型
|`INTERFACE`|[Float](#struct_Float)|浮点类型
|`INTERFACE`|[Basic](#struct_Basic)|基本类型
</details>
@@ -63,6 +63,7 @@ generic 目的在于提供一组基于泛型的用于处理通用功能的函数
> 检查指定的值是否存在 nil
***
<span id="struct_IdR"></span>
### IdR `INTERFACE`
```go
@@ -70,6 +71,7 @@ type IdR[ID comparable] interface {
GetId() ID
}
```
<span id="struct_IDR"></span>
### IDR `INTERFACE`
```go
@@ -77,6 +79,7 @@ type IDR[ID comparable] interface {
GetID() ID
}
```
<span id="struct_IdW"></span>
### IdW `INTERFACE`
```go
@@ -84,6 +87,7 @@ type IdW[ID comparable] interface {
SetId(id ID)
}
```
<span id="struct_IDW"></span>
### IDW `INTERFACE`
```go
@@ -91,6 +95,7 @@ type IDW[ID comparable] interface {
SetID(id ID)
}
```
<span id="struct_IdR2W"></span>
### IdR2W `INTERFACE`
```go
@@ -99,6 +104,7 @@ type IdR2W[ID comparable] interface {
IdW[ID]
}
```
<span id="struct_IDR2W"></span>
### IDR2W `INTERFACE`
```go
@@ -107,6 +113,7 @@ type IDR2W[ID comparable] interface {
IDW[ID]
}
```
<span id="struct_Ordered"></span>
### Ordered `INTERFACE`
可排序类型
```go
@@ -114,6 +121,7 @@ type Ordered interface {
Integer | Float | ~string
}
```
<span id="struct_Number"></span>
### Number `INTERFACE`
数字类型
```go
@@ -121,6 +129,7 @@ type Number interface {
Integer | Float
}
```
<span id="struct_SignedNumber"></span>
### SignedNumber `INTERFACE`
有符号数字类型
```go
@@ -128,6 +137,7 @@ type SignedNumber interface {
Signed | Float
}
```
<span id="struct_Integer"></span>
### Integer `INTERFACE`
整数类型
```go
@@ -135,6 +145,7 @@ type Integer interface {
Signed | Unsigned
}
```
<span id="struct_Signed"></span>
### Signed `INTERFACE`
有符号整数类型
```go
@@ -142,6 +153,7 @@ type Signed interface {
~int | ~int8 | ~int16 | ~int32 | ~int64
}
```
<span id="struct_Unsigned"></span>
### Unsigned `INTERFACE`
无符号整数类型
```go
@@ -149,6 +161,7 @@ type Unsigned interface {
UnsignedNumber | ~uintptr
}
```
<span id="struct_UnsignedNumber"></span>
### UnsignedNumber `INTERFACE`
无符号数字类型
```go
@@ -156,6 +169,7 @@ type UnsignedNumber interface {
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}
```
<span id="struct_Float"></span>
### Float `INTERFACE`
浮点类型
```go
@@ -163,6 +177,7 @@ type Float interface {
~float32 | ~float64
}
```
<span id="struct_Basic"></span>
### Basic `INTERFACE`
基本类型
```go

View File

@@ -117,15 +117,15 @@ geometry 旨在提供一组用于处理几何形状和计算几何属性的函
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Circle](#circle)|圆形
|`STRUCT`|[FloorPlan](#floorplan)|平面图
|`STRUCT`|[Direction](#direction)|方向
|`STRUCT`|[LineSegment](#linesegment)|通过两个点表示一根线段
|`STRUCT`|[LineSegmentCap](#linesegmentcap)|可以包含一份额外数据的线段
|`STRUCT`|[Point](#point)|表示了一个由 x、y 坐标组成的点
|`STRUCT`|[PointCap](#pointcap)|表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量
|`STRUCT`|[Shape](#shape)|通过多个点表示了一个形状
|`STRUCT`|[ShapeSearchOption](#shapesearchoption)|图形搜索可选项,用于 Shape.ShapeSearch 搜索支持
|`STRUCT`|[Circle](#struct_Circle)|圆形
|`STRUCT`|[FloorPlan](#struct_FloorPlan)|平面图
|`STRUCT`|[Direction](#struct_Direction)|方向
|`STRUCT`|[LineSegment](#struct_LineSegment)|通过两个点表示一根线段
|`STRUCT`|[LineSegmentCap](#struct_LineSegmentCap)|可以包含一份额外数据的线段
|`STRUCT`|[Point](#struct_Point)|表示了一个由 x、y 坐标组成的点
|`STRUCT`|[PointCap](#struct_PointCap)|表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量
|`STRUCT`|[Shape](#struct_Shape)|通过多个点表示了一个形状
|`STRUCT`|[ShapeSearchOption](#struct_ShapeSearchOption)|图形搜索可选项,用于 Shape.ShapeSearch 搜索支持
</details>
@@ -864,6 +864,7 @@ func TestNewShapeWithString(t *testing.T) {
> 通过降序的方式进行搜索
***
<span id="struct_Circle"></span>
### Circle `STRUCT`
圆形
```go
@@ -889,6 +890,7 @@ type Circle[V generic.SignedNumber] struct {
#### func (Circle) CentroidDistance(circle Circle[V]) V
> 计算与另一个圆的质心距离
***
<span id="struct_FloorPlan"></span>
### FloorPlan `STRUCT`
平面图
```go
@@ -906,11 +908,13 @@ type FloorPlan []string
#### func (FloorPlan) String() string
> 获取平面图结果
***
<span id="struct_Direction"></span>
### Direction `STRUCT`
方向
```go
type Direction uint8
```
<span id="struct_LineSegment"></span>
### LineSegment `STRUCT`
通过两个点表示一根线段
```go
@@ -928,6 +932,7 @@ type LineSegment[V generic.SignedNumber] [2]Point[V]
#### func (LineSegment) GetLength() V
> 获取该线段的长度
***
<span id="struct_LineSegmentCap"></span>
### LineSegmentCap `STRUCT`
可以包含一份额外数据的线段
```go
@@ -936,6 +941,7 @@ type LineSegmentCap[V generic.SignedNumber, Data any] struct {
Data Data
}
```
<span id="struct_Point"></span>
### Point `STRUCT`
表示了一个由 x、y 坐标组成的点
```go
@@ -989,6 +995,7 @@ type Point[V generic.SignedNumber] [2]V
#### func (Point) Min(point Point[V]) Point[V]
> 返回两个位置中每个维度的最小值组成的新的位置
***
<span id="struct_PointCap"></span>
### PointCap `STRUCT`
表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量
```go
@@ -997,6 +1004,7 @@ type PointCap[V generic.SignedNumber, D any] struct {
Data D
}
```
<span id="struct_Shape"></span>
### Shape `STRUCT`
通过多个点表示了一个形状
```go
@@ -1139,6 +1147,7 @@ func ExampleShape_ShapeSearch() {
#### func (Shape) IsPointOnEdge(point Point[V]) bool
> 检查点是否在该形状的一条边上
***
<span id="struct_ShapeSearchOption"></span>
### ShapeSearchOption `STRUCT`
图形搜索可选项,用于 Shape.ShapeSearch 搜索支持
```go

View File

@@ -28,7 +28,7 @@ astar 提供用于实现 A* 算法的函数和数据结构。A* 算法是一种
|类型|名称|描述
|:--|:--|:--
|`INTERFACE`|[Graph](#graph)|适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。
|`INTERFACE`|[Graph](#struct_Graph)|适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。
</details>
@@ -77,6 +77,7 @@ func ExampleFind() {
```
***
<span id="struct_Graph"></span>
### Graph `INTERFACE`
适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。
```go

View File

@@ -27,8 +27,8 @@ dp (DistributionPattern) 提供用于在二维数组中根据不同的特征标
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[DistributionPattern](#distributionpattern)|分布图
|`STRUCT`|[Link](#link)|暂无描述...
|`STRUCT`|[DistributionPattern](#struct_DistributionPattern)|分布图
|`STRUCT`|[Link](#struct_Link)|暂无描述...
</details>
@@ -69,6 +69,7 @@ func TestNewDistributionPattern(t *testing.T) {
***
<span id="struct_DistributionPattern"></span>
### DistributionPattern `STRUCT`
分布图
```go
@@ -104,6 +105,7 @@ type DistributionPattern[Item any] struct {
> 通过特定的成员刷新特定位置的分布关系
> - 如果矩阵通过 LoadMatrixWithPos 加载,将会重定向至 Refresh
***
<span id="struct_Link"></span>
### Link `STRUCT`
```go

View File

@@ -23,7 +23,7 @@ matrix 提供了一个简单的二维数组的实现
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Matrix](#matrix)|二维矩阵
|`STRUCT`|[Matrix](#struct_Matrix)|二维矩阵
</details>
@@ -37,6 +37,7 @@ matrix 提供了一个简单的二维数组的实现
> - 该矩阵为XY而非YX
***
<span id="struct_Matrix"></span>
### Matrix `STRUCT`
二维矩阵
```go

View File

@@ -26,7 +26,7 @@ navmesh 提供了用于导航网格处理的函数和数据结构。导航网格
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[NavMesh](#navmesh)|暂无描述...
|`STRUCT`|[NavMesh](#struct_NavMesh)|暂无描述...
</details>
@@ -54,6 +54,7 @@ navmesh 提供了用于导航网格处理的函数和数据结构。导航网格
> - 确保 NavMesh 计算精度的情况下V 建议使用 float64 类型
***
<span id="struct_NavMesh"></span>
### NavMesh `STRUCT`
```go

View File

@@ -23,7 +23,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[ObjectPool](#objectpool)|基于 sync.Pool 实现的线程安全的对象池
|`STRUCT`|[ObjectPool](#struct_ObjectPool)|基于 sync.Pool 实现的线程安全的对象池
</details>
@@ -89,6 +89,7 @@ func TestNewObjectPool(t *testing.T) {
***
<span id="struct_ObjectPool"></span>
### ObjectPool `STRUCT`
基于 sync.Pool 实现的线程安全的对象池
- 一些高频临时生成使用的对象可以通过 ObjectPool 进行管理,例如属性计算等

View File

@@ -26,8 +26,8 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Float](#float)|暂无描述...
|`STRUCT`|[Int](#int)|暂无描述...
|`STRUCT`|[Float](#struct_Float)|暂无描述...
|`STRUCT`|[Int](#struct_Int)|暂无描述...
</details>
@@ -56,6 +56,7 @@
> - 如果字符串不是一个合法的数字,则返回 0
***
<span id="struct_Float"></span>
### Float `STRUCT`
```go
@@ -117,6 +118,7 @@ type Float big.Float
#### func (*Float) IsNegative() bool
> 是否为负数
***
<span id="struct_Int"></span>
### Int `STRUCT`
```go

View File

@@ -25,9 +25,9 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[BinarySearch](#binarysearch)|暂无描述...
|`STRUCT`|[BinarySearchRankChangeEventHandle](#binarysearchrankchangeeventhandle)|暂无描述...
|`STRUCT`|[BinarySearchOption](#binarysearchoption)|暂无描述...
|`STRUCT`|[BinarySearch](#struct_BinarySearch)|暂无描述...
|`STRUCT`|[BinarySearchRankChangeEventHandle](#struct_BinarySearchRankChangeEventHandle)|暂无描述...
|`STRUCT`|[BinarySearchOption](#struct_BinarySearchOption)|暂无描述...
</details>
@@ -61,6 +61,7 @@ func ExampleNewBinarySearch() {
> - 默认情况下为降序
***
<span id="struct_BinarySearch"></span>
### BinarySearch `STRUCT`
```go
@@ -74,11 +75,13 @@ type BinarySearch[CompetitorID comparable, Score generic.Ordered] struct {
rankClearBeforeEventHandles []BinarySearchRankClearBeforeEventHandle[CompetitorID, Score]
}
```
<span id="struct_BinarySearchRankChangeEventHandle"></span>
### BinarySearchRankChangeEventHandle `STRUCT`
```go
type BinarySearchRankChangeEventHandle[CompetitorID comparable, Score generic.Ordered] func(leaderboard *BinarySearch[CompetitorID, Score], competitorId CompetitorID, oldRank int, oldScore Score)
```
<span id="struct_BinarySearchOption"></span>
### BinarySearchOption `STRUCT`
```go

View File

@@ -77,10 +77,10 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Field](#field)|暂无描述...
|`STRUCT`|[Logger](#logger)|暂无描述...
|`STRUCT`|[MultiHandler](#multihandler)|暂无描述...
|`STRUCT`|[Option](#option)|暂无描述...
|`STRUCT`|[Field](#struct_Field)|暂无描述...
|`STRUCT`|[Logger](#struct_Logger)|暂无描述...
|`STRUCT`|[MultiHandler](#struct_MultiHandler)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|暂无描述...
</details>
@@ -393,11 +393,13 @@ func TestStack(t *testing.T) {
> 创建一个新的日志选项
***
<span id="struct_Field"></span>
### Field `STRUCT`
```go
type Field slog.Attr
```
<span id="struct_Logger"></span>
### Logger `STRUCT`
```go
@@ -405,6 +407,7 @@ type Logger struct {
*slog.Logger
}
```
<span id="struct_MultiHandler"></span>
### MultiHandler `STRUCT`
```go
@@ -420,6 +423,7 @@ type MultiHandler struct {
***
#### func (MultiHandler) WithGroup(name string) slog.Handler
***
<span id="struct_Option"></span>
### Option `STRUCT`
```go

View File

@@ -32,13 +32,13 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Analyzer](#analyzer)|分析器
|`INTERFACE`|[Flusher](#flusher)|用于刷新缓冲区的接口
|`STRUCT`|[FileFlusher](#fileflusher)|暂无描述...
|`STRUCT`|[Option](#option)|选项
|`STRUCT`|[Result](#result)|暂无描述...
|`STRUCT`|[R](#r)|记录器所记录的一条数据
|`STRUCT`|[Report](#report)|分析报告
|`STRUCT`|[Analyzer](#struct_Analyzer)|分析器
|`INTERFACE`|[Flusher](#struct_Flusher)|用于刷新缓冲区的接口
|`STRUCT`|[FileFlusher](#struct_FileFlusher)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|选项
|`STRUCT`|[Result](#struct_Result)|暂无描述...
|`STRUCT`|[R](#struct_R)|记录器所记录的一条数据
|`STRUCT`|[Report](#struct_Report)|分析报告
</details>
@@ -153,6 +153,7 @@ func TestIncrementAnalyze(t *testing.T) {
***
<span id="struct_Analyzer"></span>
### Analyzer `STRUCT`
分析器
```go
@@ -214,6 +215,7 @@ type Analyzer struct {
#### func (*Analyzer) GetValueString(key string) string
> 获取当前记录的值
***
<span id="struct_Flusher"></span>
### Flusher `INTERFACE`
用于刷新缓冲区的接口
```go
@@ -222,6 +224,7 @@ type Flusher interface {
Info() string
}
```
<span id="struct_FileFlusher"></span>
### FileFlusher `STRUCT`
```go
@@ -237,16 +240,19 @@ type FileFlusher struct {
***
#### func (*FileFlusher) Info() string
***
<span id="struct_Option"></span>
### Option `STRUCT`
选项
```go
type Option func(logger *logger)
```
<span id="struct_Result"></span>
### Result `STRUCT`
```go
type Result gjson.Result
```
<span id="struct_R"></span>
### R `STRUCT`
记录器所记录的一条数据
```go
@@ -280,6 +286,7 @@ type R string
***
#### func (R) String() string
***
<span id="struct_Report"></span>
### Report `STRUCT`
分析报告
```go

View File

@@ -45,7 +45,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[CompareExpression](#compareexpression)|比较表达式
|`STRUCT`|[CompareExpression](#struct_CompareExpression)|比较表达式
</details>
@@ -213,6 +213,7 @@ func TestMakeLastDigitsZero(t *testing.T) {
***
<span id="struct_CompareExpression"></span>
### CompareExpression `STRUCT`
比较表达式
```go

View File

@@ -26,7 +26,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Option](#option)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|暂无描述...
</details>
@@ -96,6 +96,7 @@ func TestBindAction(t *testing.T) {
<span id="NewOption"></span>
***
<span id="struct_Option"></span>
### Option `STRUCT`
```go

View File

@@ -27,10 +27,10 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[TwoDimensional](#twodimensional)|用于2D对象移动的数据结构
|`INTERFACE`|[TwoDimensionalEntity](#twodimensionalentity)|2D移动对象接口定义
|`STRUCT`|[Position2DChangeEventHandle](#position2dchangeeventhandle)|暂无描述...
|`STRUCT`|[TwoDimensionalOption](#twodimensionaloption)|暂无描述...
|`STRUCT`|[TwoDimensional](#struct_TwoDimensional)|用于2D对象移动的数据结构
|`INTERFACE`|[TwoDimensionalEntity](#struct_TwoDimensionalEntity)|2D移动对象接口定义
|`STRUCT`|[Position2DChangeEventHandle](#struct_Position2DChangeEventHandle)|暂无描述...
|`STRUCT`|[TwoDimensionalOption](#struct_TwoDimensionalOption)|暂无描述...
</details>
@@ -95,6 +95,7 @@ func TestNewTwoDimensional(t *testing.T) {
<span id="NewEntity"></span>
***
<span id="struct_TwoDimensional"></span>
### TwoDimensional `STRUCT`
用于2D对象移动的数据结构
- 通过对象调用 MoveTo 方法后将开始执行该对象的移动
@@ -113,6 +114,7 @@ type TwoDimensional[EID generic.Basic, PosType generic.SignedNumber] struct {
position2DStopMoveEventHandles []Position2DStopMoveEventHandle[EID, PosType]
}
```
<span id="struct_TwoDimensionalEntity"></span>
### TwoDimensionalEntity `INTERFACE`
2D移动对象接口定义
```go
@@ -123,11 +125,13 @@ type TwoDimensionalEntity[EID generic.Basic, PosType generic.SignedNumber] inter
SetPosition(geometry.Point[PosType])
}
```
<span id="struct_Position2DChangeEventHandle"></span>
### Position2DChangeEventHandle `STRUCT`
```go
type Position2DChangeEventHandle[EID generic.Basic, PosType generic.SignedNumber] func(moving *TwoDimensional[EID, PosType], entity TwoDimensionalEntity[EID, PosType], oldX PosType)
```
<span id="struct_TwoDimensionalOption"></span>
### TwoDimensionalOption `STRUCT`
```go

View File

@@ -27,7 +27,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Time](#time)|带有偏移量的时间
|`STRUCT`|[Time](#struct_Time)|带有偏移量的时间
</details>
@@ -59,6 +59,7 @@
> 获取当前时间偏移后的时间自从 t 以来经过的时间
***
<span id="struct_Time"></span>
### Time `STRUCT`
带有偏移量的时间
```go

View File

@@ -38,7 +38,7 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Once](#once)|用于数据取值去重的结构体
|`STRUCT`|[Once](#struct_Once)|用于数据取值去重的结构体
</details>
@@ -125,6 +125,7 @@
> 获取一个自增的字符串
***
<span id="struct_Once"></span>
### Once `STRUCT`
用于数据取值去重的结构体
```go

View File

@@ -92,12 +92,12 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[BitSet](#bitset)|是一个可以动态增长的比特位集合
|`STRUCT`|[LossCounter](#losscounter)|暂无描述...
|`STRUCT`|[Matcher](#matcher)|匹配器
|`STRUCT`|[Permission](#permission)|暂无描述...
|`STRUCT`|[StackGo](#stackgo)|用于获取上一个协程调用的堆栈信息
|`STRUCT`|[VerifyHandle](#verifyhandle)|校验句柄
|`STRUCT`|[BitSet](#struct_BitSet)|是一个可以动态增长的比特位集合
|`STRUCT`|[LossCounter](#struct_LossCounter)|暂无描述...
|`STRUCT`|[Matcher](#struct_Matcher)|匹配器
|`STRUCT`|[Permission](#struct_Permission)|暂无描述...
|`STRUCT`|[StackGo](#struct_StackGo)|用于获取上一个协程调用的堆栈信息
|`STRUCT`|[VerifyHandle](#struct_VerifyHandle)|校验句柄
</details>
@@ -739,6 +739,7 @@ func BenchmarkCompareVersion(b *testing.B) {
***
<span id="struct_BitSet"></span>
### BitSet `STRUCT`
是一个可以动态增长的比特位集合
- 默认情况下将使用 64 位无符号整数来表示比特位,当需要表示的比特位超过 64 位时,将自动增长
@@ -907,6 +908,7 @@ func TestBitSet_Shrink(t *testing.T) {
#### func (*BitSet) UnmarshalJSON(data []byte) error
> 实现 json.Unmarshaler 接口
***
<span id="struct_LossCounter"></span>
### LossCounter `STRUCT`
```go
@@ -924,6 +926,7 @@ type LossCounter struct {
***
#### func (*LossCounter) String() string
***
<span id="struct_Matcher"></span>
### Matcher `STRUCT`
匹配器
```go
@@ -933,6 +936,7 @@ type Matcher[Value any, Result any] struct {
d bool
}
```
<span id="struct_Permission"></span>
### Permission `STRUCT`
```go
@@ -941,6 +945,7 @@ type Permission[Code generic.Integer, EntityID comparable] struct {
l sync.RWMutex
}
```
<span id="struct_StackGo"></span>
### StackGo `STRUCT`
用于获取上一个协程调用的堆栈信息
- 应当最先运行 Wait 函数,然后在其他协程中调用 Stack 函数或者 GiveUp 函数
@@ -965,6 +970,7 @@ type StackGo struct {
> - 在调用 Wait 函数后调用该函数,将会放弃收集消息堆栈并且释放资源
> - 在调用 GiveUp 函数后调用 Stack 函数,将会 panic
***
<span id="struct_VerifyHandle"></span>
### VerifyHandle `STRUCT`
校验句柄
```go

View File

@@ -31,11 +31,11 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[SystemNewDayEventHandle](#systemnewdayeventhandle)|暂无描述...
|`STRUCT`|[Option](#option)|暂无描述...
|`STRUCT`|[Pool](#pool)|定时器池
|`STRUCT`|[Scheduler](#scheduler)|调度器
|`STRUCT`|[Ticker](#ticker)|定时器
|`STRUCT`|[SystemNewDayEventHandle](#struct_SystemNewDayEventHandle)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|暂无描述...
|`STRUCT`|[Pool](#struct_Pool)|定时器池
|`STRUCT`|[Scheduler](#struct_Scheduler)|调度器
|`STRUCT`|[Ticker](#struct_Ticker)|定时器
</details>
@@ -92,16 +92,19 @@
> 获取标准池中的一个定时器
***
<span id="struct_SystemNewDayEventHandle"></span>
### SystemNewDayEventHandle `STRUCT`
```go
type SystemNewDayEventHandle func()
```
<span id="struct_Option"></span>
### Option `STRUCT`
```go
type Option func(ticker *Ticker)
```
<span id="struct_Pool"></span>
### Pool `STRUCT`
定时器池
```go
@@ -123,6 +126,7 @@ type Pool struct {
> 释放定时器池的资源,释放后由其产生的 Ticker 在 Ticker.Release 后将不再回到池中,而是直接释放
> - 虽然定时器池已被释放,但是依旧可以产出 Ticker
***
<span id="struct_Scheduler"></span>
### Scheduler `STRUCT`
调度器
```go
@@ -150,6 +154,7 @@ type Scheduler struct {
#### func (*Scheduler) Caller()
> 可由外部发起调用的执行函数
***
<span id="struct_Ticker"></span>
### Ticker `STRUCT`
定时器
```go

View File

@@ -70,8 +70,8 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[StateLine](#stateline)|状态时间线
|`STRUCT`|[Period](#period)|表示一个时间段
|`STRUCT`|[StateLine](#struct_StateLine)|状态时间线
|`STRUCT`|[Period](#struct_Period)|表示一个时间段
</details>
@@ -399,6 +399,7 @@ func TestNewPeriodWindow(t *testing.T) {
> 创建一个时间段,从 t 开始,持续 nanosecond 纳秒
***
<span id="struct_StateLine"></span>
### StateLine `STRUCT`
状态时间线
```go
@@ -486,6 +487,7 @@ type StateLine[State generic.Basic] struct {
#### func (*StateLine) RangeReverse(handler func (index int, state State, t time.Time) bool)
> 按照时间逆序遍历时间线
***
<span id="struct_Period"></span>
### Period `STRUCT`
表示一个时间段
```go