function

package
v0.0.0-...-d1826b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FunctionTypeSimple   = 0 // End of simple chain
	FunctionTypeContinue = 1 // Simple chain
	FunctionTypeRegular  = 2
)
View Source
const (
	SimpleFunctionArgumentString  = 0
	SimpleFunctionArgumentDecider = 1
	SimpleFunctionArgumentInt     = 2
	SimpleFunctionArgumentMessage = 3
	SimpleFunctionArgumentEnum    = 4
)

Variables

View Source
var FunctionMap = make(map[string]*Function)
View Source
var SimpleFunctionEnums []*EnumInfo

Functions

func InitInternalFunctions

func InitInternalFunctions()

func Process

func Process(conn *minecraft.Conn, msg string)

func RegisterEnum

func RegisterEnum(desc string, parser func(string) byte, inv byte) int

func RegisterFunction

func RegisterFunction(function *Function)

Types

type EnumInfo

type EnumInfo struct {
	WantedValuesDescription string // "discrete, continuous, none"
	Parser                  func(string) byte
	InvalidValue            byte
}

type Function

type Function struct {
	Name          string
	OwnedKeywords []string

	FunctionType    byte
	SFMinSliceLen   uint16
	SFArgumentTypes []byte
	FunctionContent interface{} // Regular/Simple: func(*minecraft.Conn,interface{})

}

type FunctionChainItem

type FunctionChainItem struct {
	FunctionType  byte
	ArgumentTypes []byte
	Content       interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL