printer

package
v0.0.0-...-a7dee75 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPrinter

func RegisterPrinter(ext string, p Printer)

func WriteTiledData

func WriteTiledData(g *Globals, bf *Stream, patterns ...string)

Types

type EditorMap

type EditorMap struct {
	XMLName      xml.Name `xml:"tileset"`
	Text         string   `xml:",chardata"`
	Version      string   `xml:"version,attr"`
	Tiledversion string   `xml:"tiledversion,attr"`
	Name         string   `xml:"name,attr"`
	Tilewidth    string   `xml:"tilewidth,attr"`
	Tileheight   string   `xml:"tileheight,attr"`
	Tilecount    string   `xml:"tilecount,attr"`
	Columns      string   `xml:"columns,attr"`
	Image        struct {
		Source string `xml:"source,attr"`
	} `xml:"image"`

	Tile []struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr"`
		Type string `xml:"type,attr"`
	} `xml:"tile"`
}

type GameMap

type GameMap struct {
	ID        int32
	Name      string
	Width     int32
	Height    int32
	Xsize     int32
	HalfXsize int32
	Xcount    int32
	Ysize     int32
	HalfYsize int32
	Ycount    int32
	Tiles     []int32
}

type Globals

type Globals struct {
	Version            string
	InputFileList      []interface{}
	ParaMode           bool
	CacheDir           string
	UseCache           bool
	ProtoVersion       int
	LuaEnumIntValue    bool
	LuaTabHeader       string
	GenCSSerailizeCode bool
	PackageName        string
	ModList            []string
	FieldMark          string
	TiledFileDir       string

	Printers []*PrinterContext

	CombineStructName string // 不包含路径, 用作

	*model.FileDescriptor // 类型信息.用于添加各种导出结构

	Tables []*model.Table // 数据信息.表格数据

	GlobalIndexes []TableIndex      // 类型信息.全局索引
	CombineStruct *model.Descriptor // 类型信息.Combine结构体

	BuildID string
	// contains filtered or unexported fields
}

func NewGlobals

func NewGlobals() *Globals

func (*Globals) AddContent

func (self *Globals) AddContent(tab *model.Table) bool

合并每个表带的类型

func (*Globals) AddOutputType

func (self *Globals) AddOutputType(name string, outfile string)

func (*Globals) AddTypes

func (self *Globals) AddTypes(localFD *model.FileDescriptor) bool

func (*Globals) PreExport

func (self *Globals) PreExport() bool

func (*Globals) Print

func (self *Globals) Print() bool

func (*Globals) PrintCodeFile

func (self *Globals) PrintCodeFile() bool

func (*Globals) PrintDataFile

func (self *Globals) PrintDataFile() bool

type Printer

type Printer interface {
	Run(g *Globals) *Stream
}

type PrinterContext

type PrinterContext struct {
	// contains filtered or unexported fields
}

func (*PrinterContext) Start

func (self *PrinterContext) Start(g *Globals) bool

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NewStream

func NewStream() *Stream

func (*Stream) Buffer

func (self *Stream) Buffer() *bytes.Buffer

func (*Stream) Len

func (self *Stream) Len() int

func (*Stream) Printf

func (self *Stream) Printf(format string, args ...interface{})

func (*Stream) WriteBytes

func (self *Stream) WriteBytes(v []byte)

func (*Stream) WriteFile

func (self *Stream) WriteFile(outfile string) error

func (*Stream) WriteInt32

func (self *Stream) WriteInt32(v int32)

func (*Stream) WriteNodeValue

func (self *Stream) WriteNodeValue(ft model.FieldType, value *model.Node)

func (*Stream) WriteRawBytes

func (self *Stream) WriteRawBytes(b []byte)

func (*Stream) WriteString

func (self *Stream) WriteString(v string)

type TableIndex

type TableIndex struct {
	Index *model.FieldDescriptor // 表头里的索引
	Row   *model.FieldDescriptor // 索引的数据
}

Jump to

Keyboard shortcuts

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