Documentation ¶
Index ¶
- Variables
- func Complete(d prompt.Document, adv advisor.Advisor, args []string) (suggestions []prompt.Suggest)
- func Completer(d prompt.Document) []prompt.Suggest
- func Exec()
- func Exit(code int)
- func FindHandler(adv advisor.Advisor, args []string) (handler func(argument string))
- func FirstLetterUpperCaseLegalSuggesterFunc() advisor.SuggesterFunc
- func InitializeJudgeSuggesterFunc(context *data.Context) advisor.SuggesterFunc
- func LegalJudgeSuggesterFunc(isLegal func(argument string) bool) advisor.SuggesterFunc
- func NewNewSkillContextToCreatSkillArgumentAdapter() adapter.Adapter[NewSkillContext, data.CreateSkillArguments]
- func PackagePathLegalSuggesterFunc() advisor.SuggesterFunc
- func StaticSuggesterFunc(staticSuggestions ...prompt.Suggest) advisor.SuggesterFunc
- type Command
- type EntityType
- type HandlerFunc
- type InitModContext
- type NewCardContext
- type NewCharacterContext
- type NewRuleContext
- type NewSkillContext
- type NewSkillContextToCreatSkillArgumentAdapter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllCommand = []Command{ CommandInitMod, CommandNewEntity, CommandModifyEntity, CommandDeleteEntity, CommandAddDescription, CommandList, CommandExit, } )
View Source
var ( AllEntityType = []EntityType{ EntityCharacter, EntitySkill, EntityEvent, EntitySummon, EntityCard, EntityRule, } )
Functions ¶
func FindHandler ¶
FindHandler 递归解析Advisor的语法树结构,查找命令的执行函数,O(n)
func FirstLetterUpperCaseLegalSuggesterFunc ¶
func FirstLetterUpperCaseLegalSuggesterFunc() advisor.SuggesterFunc
func InitializeJudgeSuggesterFunc ¶
func InitializeJudgeSuggesterFunc(context *data.Context) advisor.SuggesterFunc
func LegalJudgeSuggesterFunc ¶
func LegalJudgeSuggesterFunc(isLegal func(argument string) bool) advisor.SuggesterFunc
func NewNewSkillContextToCreatSkillArgumentAdapter ¶
func NewNewSkillContextToCreatSkillArgumentAdapter() adapter.Adapter[NewSkillContext, data.CreateSkillArguments]
func PackagePathLegalSuggesterFunc ¶
func PackagePathLegalSuggesterFunc() advisor.SuggesterFunc
func StaticSuggesterFunc ¶
func StaticSuggesterFunc(staticSuggestions ...prompt.Suggest) advisor.SuggesterFunc
Types ¶
type EntityType ¶
type EntityType = string
const ( EntityCharacter EntityType = "character" EntitySkill EntityType = "skill" EntityEvent EntityType = "event" EntitySummon EntityType = "summon" EntityCard EntityType = "card" EntityRule EntityType = "rule" )
type HandlerFunc ¶
type HandlerFunc func(argument string)
func ExitCliHandler ¶
func ExitCliHandler() HandlerFunc
func InitModHandler ¶
func InitModHandler(ctx *data.Context) HandlerFunc
func NewCharacterHandler ¶
func NewCharacterHandler(ctx *data.Context) HandlerFunc
type InitModContext ¶
type InitModContext struct{}
type NewCardContext ¶
type NewCardContext struct{}
type NewCharacterContext ¶
type NewCharacterContext struct {
CharacterName string
}
type NewRuleContext ¶
type NewRuleContext struct{}
type NewSkillContext ¶
type NewSkillContextToCreatSkillArgumentAdapter ¶
type NewSkillContextToCreatSkillArgumentAdapter struct{}
func (NewSkillContextToCreatSkillArgumentAdapter) Convert ¶
func (adapter NewSkillContextToCreatSkillArgumentAdapter) Convert(source NewSkillContext) (success bool, result data.CreateSkillArguments)
Click to show internal directories.
Click to hide internal directories.