gdGenerator

package
v0.0.0-...-e0921b9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LanguageName = "Go"
)

Variables

View Source
var (
	LanguageAliases = []string{
		"gd",
		"godot",
		"gdscript",
	}

	CCLTypesToGdTypes = map[string]string{
		"int":      "int",
		"uint":     "int",
		"int8":     "int",
		"uint8":    "int",
		"int16":    "int",
		"uint16":   "int",
		"int32":    "int",
		"uint32":   "int",
		"int64":    "int",
		"uint64":   "int",
		"float":    "float",
		"float64":  "float",
		"float32":  "float",
		"string":   "String",
		"bool":     "bool",
		"datetime": "int",
		"bytes":    "PackedByteArray",
	}
)

Functions

func GenerateCode

func GenerateCode(options *gen.CodeGenerationOptions) (*gen.CodeGenerationResult, error)

GenerateCode generates GDScript code from the provided CCL source file.

func ToCamelCase

func ToCamelCase(s string) string

func ToPascalCase

func ToPascalCase(str string) string

func ToSnakeCase

func ToSnakeCase(camel string) (snake string)

Types

type CCLField

type CCLField = cclValues.FieldDefinition

CCLField is a type alias for the field definition type from the CCL library.

type CCLModel

type CCLModel = cclValues.ModelDefinition

CCLModel is a type alias for the model definition type from the CCL library.

type GDScriptGenerationContext

type GDScriptGenerationContext struct {
	Options *gen.CodeGenerationOptions
	// One builder per model class file
	ModelClasses map[string]*strings.Builder
}

func (*GDScriptGenerationContext) GenerateCode

func (c *GDScriptGenerationContext) GenerateCode() error

func (*GDScriptGenerationContext) GenerateModelClass

func (c *GDScriptGenerationContext) GenerateModelClass(model *CCLModel) error

func (*GDScriptGenerationContext) IsCustomType

func (c *GDScriptGenerationContext) IsCustomType(cclType string) bool

Jump to

Keyboard shortcuts

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