Documentation ¶
Overview ¶
Package bin implements a decoder and encoder for Roblox's binary file format.
The easiest way to decode and encode files is through the functions DeserializePlace, SerializePlace, DeserializeModel, and SerializeModel. These decode and encode directly between byte streams and Root structures specified by the rbxfile package. For most purposes, this is all that is required to read and write Roblox binary files. Further documentation gives an overview of how the package works internally.
Overview ¶
A Serializer is used to transform data from byte streams to Root structures and back. A serializer specifies a decoder and encoder. Both a decoder and encoder combined is referred to as a "codec".
Codecs transform data between a generic rbxfile.Root structure, and this package's "format model" structure. Custom codecs can be implemented. For example, you might wish to decode files normally, but encode them in an alternative way:
serializer := NewSerializer(nil, CustomEncoder)
Custom codecs can be used with a Serializer by implementing the Decoder and Encoder interfaces. Both do not need to be implemented. In the example above, passing nil as an argument causes the serializer to use the default "RobloxCodec", which implements both a default decoder and encoder. This codec attempts to emulate how Roblox decodes and encodes its files.
A FormatModel is the representation of the file format itself, rather than the data it contains. The FormatModel is like a buffer between the byte stream and the Root structure. FormatModels can be encoded (and rarely, decoded) to and from Root structures in multiple ways, which is specified by codecs. However, there is only one way to encode and decode to and from a byte stream, which is handled by the FormatModel.
Index ¶
- Constants
- Variables
- func DeserializeModel(r io.Reader, api rbxapi.Root) (root *rbxfile.Root, err error)
- func DeserializePlace(r io.Reader, api rbxapi.Root) (root *rbxfile.Root, err error)
- func SerializeModel(w io.Writer, api rbxapi.Root, root *rbxfile.Root) (err error)
- func SerializePlace(w io.Writer, api rbxapi.Root, root *rbxfile.Root) (err error)
- type Chunk
- type ChunkEnd
- type ChunkInstance
- type ChunkMeta
- type ChunkParent
- type ChunkProperty
- type ChunkSharedStrings
- type ChunkUnknown
- type Decoder
- type Encoder
- type ErrChunk
- type ErrInvalidType
- type ErrUnrecognizedVersion
- type ErrValue
- type FormatModel
- type Mode
- type RobloxCodec
- type Serializer
- type SharedString
- type Type
- type Value
- type ValueAxes
- type ValueBool
- type ValueBrickColor
- type ValueCFrame
- type ValueColor3
- type ValueColor3uint8
- type ValueColorSequence
- type ValueColorSequenceKeypoint
- type ValueDouble
- type ValueFaces
- type ValueFloat
- type ValueInt
- type ValueInt64
- type ValueNumberRange
- type ValueNumberSequence
- type ValueNumberSequenceKeypoint
- type ValuePhysicalProperties
- func (v *ValuePhysicalProperties) ArrayBytes(a []Value) (b []byte, err error)
- func (v ValuePhysicalProperties) Bytes() []byte
- func (v ValuePhysicalProperties) FromArrayBytes(b []byte) (a []Value, err error)
- func (v *ValuePhysicalProperties) FromBytes(b []byte) error
- func (ValuePhysicalProperties) Type() Type
- type ValueRay
- type ValueRect2D
- type ValueReference
- type ValueSharedString
- type ValueString
- type ValueToken
- type ValueUDim
- type ValueUDim2
- type ValueVector2
- type ValueVector2int16
- type ValueVector3
- type ValueVector3int16
Constants ¶
const BinaryHeader = "\x89\xff\r\n\x1a\n"
BinaryHeader is the header magic of a binary file.
const BinaryMarker = "!"
BinaryMarker indicates the start of a binary file, rather than an XML file.
const RobloxSig = "<roblox"
RobloxSig is the signature a Roblox file (binary or XML).
Variables ¶
var ( ErrInvalidSig = errors.New("invalid signature") ErrCorruptHeader = errors.New("the file header is corrupted") ErrChunkParentArray = errors.New("length of parent array does not match children array") )
var ( WarnReserveNonZero = errors.New("reserved space in file header is non-zero") WarnEndChunkCompressed = errors.New("end chunk is compressed") WarnEndChunkContent = errors.New("end chunk content is not `</roblox>`") WarnEndChunkNotLast = errors.New("end chunk is not the last chunk") )
Functions ¶
func DeserializeModel ¶
Deserialize decodes data from r into a Root structure using the default decoder. Data is interpreted as a Roblox model file. An optional API can be given to ensure more correct data.
func DeserializePlace ¶
Deserialize decodes data from r into a Root structure using the default decoder. Data is interpreted as a Roblox place file. An optional API can be given to ensure more correct data.
func SerializeModel ¶
Serialize encodes data from a Root structure to w using the default encoder. Data is interpreted as a Roblox model file. An optional API can be given to ensure more correct data.
Types ¶
type Chunk ¶
type Chunk interface { // Signature returns a signature used to identify the chunk's type. Signature() [4]byte // Compressed returns whether the chunk was compressed when decoding, or // whether thed chunk should be compressed when encoding. Compressed() bool // SetCompressed sets whether the chunk should be compressed when // encoding. SetCompressed(bool) // ReadFrom processes the payload of a decompressed chunk. ReadFrom(r io.Reader) (n int64, err error) // WriteTo writes the data from a chunk to an uncompressed payload. The // payload will be compressed afterward depending on the chunk's // compression settings. WriteTo(w io.Writer) (n int64, err error) }
Chunk is a portion of the model that contains distinct data.
type ChunkEnd ¶
type ChunkEnd struct { // Whether the chunk is compressed. IsCompressed bool // The raw decompressed content of the chunk. For maximum compatibility, // the content should be "</roblox>", and the chunk should be // uncompressed. The decoder will emit warnings indicating such, if this // is not the case. Content []byte }
ChunkEnd is a Chunk that signals the end of the file. It causes the decoder to stop reading chunks, so it should be the last chunk.
func (*ChunkEnd) Compressed ¶
func (*ChunkEnd) SetCompressed ¶
type ChunkInstance ¶
type ChunkInstance struct { // Whether the chunk is compressed. IsCompressed bool // TypeID is a number identifying the instance group. TypeID int32 // ClassName indicates the ClassName property of each instance in the // group. ClassName string // InstanceIDs is a list of numbers that identify each instance in the // group, which can be referred to in other chunks. The length of the // array indicates how many instances are in the group. InstanceIDs []int32 // IsService indicates the chunk has GetService flags. IsService bool // GetService is a list of flags indicating how to treat each instance in // the group. Each byte in the list corresponds to the instance in // InstanceIDs. // // A value of 0x0 will treat the instance normally, using Instance.new() // to create the instance. // // A value of 0x1 will treat the instance as a service, using // game:GetService() to get the instance. GetService []byte }
ChunkInstance is a Chunk that contains information about the instances in the file. Instances of the same ClassName are grouped together into this kind of chunk, which are called "instance groups".
func (*ChunkInstance) Compressed ¶
func (c *ChunkInstance) Compressed() bool
func (*ChunkInstance) SetCompressed ¶
func (c *ChunkInstance) SetCompressed(b bool)
func (ChunkInstance) Signature ¶
func (ChunkInstance) Signature() [4]byte
type ChunkMeta ¶
ChunkMeta is a Chunk that contains file metadata.
func (*ChunkMeta) Compressed ¶
func (*ChunkMeta) SetCompressed ¶
type ChunkParent ¶
type ChunkParent struct { // Whether the chunk is compressed. IsCompressed bool // Version is the version of the chunk. Reserved so that the format of the // parent chunk can be changed without changing the version of the entire // file format. Version uint8 // Children is a list of instances referred to by instance ID. The length // of this array should be equal to InstanceCount. Children []int32 // Parents is a list of instances, referred to by instance ID, that // indicate the Parent of the corresponding instance in the Children // array. The length of this array should be equal to the length of // Children. Parents []int32 }
ChunkParent is a Chunk that contains information about the parent-child relationships between instances in the model.
func (*ChunkParent) Compressed ¶
func (c *ChunkParent) Compressed() bool
func (*ChunkParent) SetCompressed ¶
func (c *ChunkParent) SetCompressed(b bool)
func (ChunkParent) Signature ¶
func (ChunkParent) Signature() [4]byte
type ChunkProperty ¶
type ChunkProperty struct { // Whether the chunk is compressed. IsCompressed bool // TypeID is the ID of an instance group contained in a ChunkInstance. TypeID int32 // PropertyName is the name of a valid property in each instance of the // corresponding instance group. PropertyName string // DataType is a number indicating the type of the property. DataType Type // Properties is a list of Values of the given DataType. Each value in the // array corresponds to the property of an instance in the specified // group. Properties []Value }
ChunkProperty is a Chunk that contains information about the properties of a group of instances.
func (*ChunkProperty) Compressed ¶
func (c *ChunkProperty) Compressed() bool
func (*ChunkProperty) SetCompressed ¶
func (c *ChunkProperty) SetCompressed(b bool)
func (ChunkProperty) Signature ¶
func (ChunkProperty) Signature() [4]byte
type ChunkSharedStrings ¶
type ChunkSharedStrings struct { bool }IsCompressed
ChunkSharedStrings is a Chunk that contains shared strings.
func (*ChunkSharedStrings) Compressed ¶
func (c *ChunkSharedStrings) Compressed() bool
func (*ChunkSharedStrings) ReadFrom ¶
func (c *ChunkSharedStrings) ReadFrom(r io.Reader) (n int64, err error)
func (*ChunkSharedStrings) SetCompressed ¶
func (c *ChunkSharedStrings) SetCompressed(b bool)
func (ChunkSharedStrings) Signature ¶
func (ChunkSharedStrings) Signature() [4]byte
type ChunkUnknown ¶
type ChunkUnknown struct { // Whether the chunk is compressed. IsCompressed bool // The signature of the chunk. Sig [4]byte // The raw content of the chunk. Bytes []byte }
ChunkUnknown is a Chunk that is not known by the format.
func (*ChunkUnknown) Compressed ¶
func (c *ChunkUnknown) Compressed() bool
func (*ChunkUnknown) Error ¶
func (c *ChunkUnknown) Error() string
func (*ChunkUnknown) SetCompressed ¶
func (c *ChunkUnknown) SetCompressed(b bool)
func (*ChunkUnknown) Signature ¶
func (c *ChunkUnknown) Signature() [4]byte
type Decoder ¶
type Decoder interface {
Decode(model *FormatModel) (root *rbxfile.Root, err error)
}
Decoder decodes a FormatModel to a generic rbxfile.Root structure.
type Encoder ¶
type Encoder interface {
Encode(root *rbxfile.Root) (model *FormatModel, err error)
}
Encoder encodes a rbxfile.Root structure to a FormatModel.
type ErrInvalidType ¶
type ErrInvalidType struct { Chunk *ChunkProperty Bytes []byte }
func (*ErrInvalidType) Error ¶
func (err *ErrInvalidType) Error() string
type ErrUnrecognizedVersion ¶
type ErrUnrecognizedVersion uint16
func (ErrUnrecognizedVersion) Error ¶
func (err ErrUnrecognizedVersion) Error() string
type FormatModel ¶
type FormatModel struct { // Version indicates the version of the format model. Version uint16 // TypeCount is the number of instance types in the model. TypeCount uint32 // InstanceCount is the number of unique instances in the model. InstanceCount uint32 // Chunks is a list of Chunks present in the model. Chunks []Chunk // If Strict is true, certain errors normally emitted as warnings are // instead emitted as errors. Strict bool // Warnings is a list of non-fatal problems that have occurred. This will // be cleared and populated when calling either ReadFrom and WriteTo. // Codecs may also clear and populate this when decoding or encoding. Warnings []error }
FormatModel models Roblox's binary file format. Directly, it can be used to control exactly how a file is encoded.
type RobloxCodec ¶
type RobloxCodec struct { // API can be set to yield a more correct encoding or decoding by // providing information about each class. If API is nil, the codec will // try to use other available information, but may not be fully accurate. API rbxapi.Root Mode Mode // ExcludeInvalidAPI determines whether invalid items are excluded when // encoding or decoding. An invalid item is an instance or property that // does not exist or has incorrect information, according to a provided // rbxapi.Root. // // If true, then warnings will be emitted for invalid items, and the items // will not be included in the output. If false, then warnings are still // emitted, but invalid items are handled as if they were valid. This // applies when decoding from a FormatModel, and when encoding from a // rbxfile.Root. // // Since an API may exclude some items even though they're correct, it is // generally preferred to set ExcludeInvalidAPI to false, so that false // negatives do not lead to lost data. ExcludeInvalidAPI bool }
RobloxCodec implements Decoder and Encoder to emulate Roblox's internal codec as closely as possible.
func (RobloxCodec) Decode ¶
func (c RobloxCodec) Decode(model *FormatModel) (root *rbxfile.Root, err error)
func (RobloxCodec) Encode ¶
func (c RobloxCodec) Encode(root *rbxfile.Root) (model *FormatModel, err error)
type Serializer ¶
type Serializer struct { Decoder Decoder Encoder Encoder // DecoderXML is used to decode the legacy XML format. If DecoderXML is // not nil, then the serializer will attempt to detect if the stream is in // the XML format. If so, then it will be decoded using an xml.Serializer // with the given decoder. DecoderXML xml.Decoder }
Serializer implements functions that decode and encode directly between byte streams and rbxfile Root structures.
func NewSerializer ¶
func NewSerializer(d Decoder, e Encoder) Serializer
NewSerializer returns a new Serializer with a specified decoder and encoder. If either value is nil, the default RobloxCodec will be used in its place. DecoderXML is set to xml.RobloxCodec.
func (Serializer) Deserialize ¶
Deserialize decodes data from r into a Root structure using the specified decoder. An optional API can be given to ensure more correct data.
type SharedString ¶
type SharedString struct {}
type Type ¶
type Type byte
Type indicates the type of a Value.
const ( TypeInvalid Type = 0x0 TypeString Type = 0x1 TypeBool Type = 0x2 TypeInt Type = 0x3 TypeFloat Type = 0x4 TypeDouble Type = 0x5 TypeUDim Type = 0x6 TypeUDim2 Type = 0x7 TypeRay Type = 0x8 TypeFaces Type = 0x9 TypeAxes Type = 0xA TypeBrickColor Type = 0xB TypeColor3 Type = 0xC TypeVector2 Type = 0xD TypeVector3 Type = 0xE TypeVector2int16 Type = 0xF TypeCFrame Type = 0x10 //TypeCFrameQuat Type = 0x11 TypeToken Type = 0x12 TypeReference Type = 0x13 TypeVector3int16 Type = 0x14 TypeNumberSequence Type = 0x15 TypeColorSequence Type = 0x16 TypeNumberRange Type = 0x17 TypeRect2D Type = 0x18 TypePhysicalProperties Type = 0x19 TypeColor3uint8 Type = 0x1A TypeInt64 Type = 0x1B )
type Value ¶
type Value interface { // Type returns an identifier indicating the type. Type() Type // FromBytes receives the value of the type from a byte array. FromBytes([]byte) error // Bytes returns the encoded value of the type as a byte array. Bytes() []byte // FromArrayBytes receives an array of values of the type from a byte // array. FromArrayBytes([]byte) ([]Value, error) // ArrayBytes returns an array of values of the type encoded as a byte // array. ArrayBytes([]Value) ([]byte, error) }
Value is a property value of a certain Type.
type ValueBrickColor ¶
type ValueBrickColor uint32
func (*ValueBrickColor) ArrayBytes ¶
func (v *ValueBrickColor) ArrayBytes(a []Value) (b []byte, err error)
func (ValueBrickColor) Bytes ¶
func (v ValueBrickColor) Bytes() []byte
func (ValueBrickColor) FromArrayBytes ¶
func (v ValueBrickColor) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueBrickColor) FromBytes ¶
func (v *ValueBrickColor) FromBytes(b []byte) error
func (ValueBrickColor) Type ¶
func (ValueBrickColor) Type() Type
type ValueCFrame ¶
type ValueCFrame struct { Special uint8 Rotation [9]float32 Position ValueVector3 }
func (*ValueCFrame) ArrayBytes ¶
func (v *ValueCFrame) ArrayBytes(a []Value) (b []byte, err error)
func (ValueCFrame) Bytes ¶
func (v ValueCFrame) Bytes() []byte
func (ValueCFrame) FromArrayBytes ¶
func (v ValueCFrame) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueCFrame) FromBytes ¶
func (v *ValueCFrame) FromBytes(b []byte) error
func (ValueCFrame) Type ¶
func (ValueCFrame) Type() Type
type ValueColor3 ¶
type ValueColor3 struct {
R, G, B ValueFloat
}
func (ValueColor3) ArrayBytes ¶
func (v ValueColor3) ArrayBytes(a []Value) (b []byte, err error)
func (ValueColor3) Bytes ¶
func (v ValueColor3) Bytes() []byte
func (ValueColor3) FromArrayBytes ¶
func (v ValueColor3) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueColor3) FromBytes ¶
func (v *ValueColor3) FromBytes(b []byte) error
func (ValueColor3) Type ¶
func (ValueColor3) Type() Type
type ValueColor3uint8 ¶
type ValueColor3uint8 struct {
R, G, B byte
}
func (ValueColor3uint8) ArrayBytes ¶
func (v ValueColor3uint8) ArrayBytes(a []Value) (b []byte, err error)
func (ValueColor3uint8) Bytes ¶
func (v ValueColor3uint8) Bytes() []byte
func (ValueColor3uint8) FromArrayBytes ¶
func (v ValueColor3uint8) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueColor3uint8) FromBytes ¶
func (v *ValueColor3uint8) FromBytes(b []byte) error
func (ValueColor3uint8) Type ¶
func (ValueColor3uint8) Type() Type
type ValueColorSequence ¶
type ValueColorSequence []ValueColorSequenceKeypoint
func (*ValueColorSequence) ArrayBytes ¶
func (v *ValueColorSequence) ArrayBytes(a []Value) (b []byte, err error)
func (ValueColorSequence) Bytes ¶
func (v ValueColorSequence) Bytes() []byte
func (ValueColorSequence) FromArrayBytes ¶
func (v ValueColorSequence) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueColorSequence) FromBytes ¶
func (v *ValueColorSequence) FromBytes(b []byte) error
func (ValueColorSequence) Type ¶
func (ValueColorSequence) Type() Type
type ValueColorSequenceKeypoint ¶
type ValueColorSequenceKeypoint struct { Time float32 Value ValueColor3 Envelope float32 }
type ValueDouble ¶
type ValueDouble float64
func (*ValueDouble) ArrayBytes ¶
func (v *ValueDouble) ArrayBytes(a []Value) (b []byte, err error)
func (ValueDouble) Bytes ¶
func (v ValueDouble) Bytes() []byte
func (ValueDouble) FromArrayBytes ¶
func (v ValueDouble) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueDouble) FromBytes ¶
func (v *ValueDouble) FromBytes(b []byte) error
func (ValueDouble) Type ¶
func (ValueDouble) Type() Type
type ValueFaces ¶
type ValueFaces struct {
Right, Top, Back, Left, Bottom, Front bool
}
func (*ValueFaces) ArrayBytes ¶
func (v *ValueFaces) ArrayBytes(a []Value) (b []byte, err error)
func (ValueFaces) Bytes ¶
func (v ValueFaces) Bytes() []byte
func (ValueFaces) FromArrayBytes ¶
func (v ValueFaces) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueFaces) FromBytes ¶
func (v *ValueFaces) FromBytes(b []byte) error
func (ValueFaces) Type ¶
func (ValueFaces) Type() Type
type ValueFloat ¶
type ValueFloat float32
func (*ValueFloat) ArrayBytes ¶
func (v *ValueFloat) ArrayBytes(a []Value) (b []byte, err error)
func (ValueFloat) Bytes ¶
func (v ValueFloat) Bytes() []byte
func (ValueFloat) FromArrayBytes ¶
func (v ValueFloat) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueFloat) FromBytes ¶
func (v *ValueFloat) FromBytes(b []byte) error
func (ValueFloat) Type ¶
func (ValueFloat) Type() Type
type ValueInt64 ¶
type ValueInt64 int64
func (*ValueInt64) ArrayBytes ¶
func (v *ValueInt64) ArrayBytes(a []Value) (b []byte, err error)
func (ValueInt64) Bytes ¶
func (v ValueInt64) Bytes() []byte
func (ValueInt64) FromArrayBytes ¶
func (v ValueInt64) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueInt64) FromBytes ¶
func (v *ValueInt64) FromBytes(b []byte) error
func (ValueInt64) Type ¶
func (ValueInt64) Type() Type
type ValueNumberRange ¶
type ValueNumberRange struct {
Min, Max float32
}
func (*ValueNumberRange) ArrayBytes ¶
func (v *ValueNumberRange) ArrayBytes(a []Value) (b []byte, err error)
func (ValueNumberRange) Bytes ¶
func (v ValueNumberRange) Bytes() []byte
func (ValueNumberRange) FromArrayBytes ¶
func (v ValueNumberRange) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueNumberRange) FromBytes ¶
func (v *ValueNumberRange) FromBytes(b []byte) error
func (ValueNumberRange) Type ¶
func (ValueNumberRange) Type() Type
type ValueNumberSequence ¶
type ValueNumberSequence []ValueNumberSequenceKeypoint
func (*ValueNumberSequence) ArrayBytes ¶
func (v *ValueNumberSequence) ArrayBytes(a []Value) (b []byte, err error)
func (ValueNumberSequence) Bytes ¶
func (v ValueNumberSequence) Bytes() []byte
func (ValueNumberSequence) FromArrayBytes ¶
func (v ValueNumberSequence) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueNumberSequence) FromBytes ¶
func (v *ValueNumberSequence) FromBytes(b []byte) error
func (ValueNumberSequence) Type ¶
func (ValueNumberSequence) Type() Type
type ValueNumberSequenceKeypoint ¶
type ValueNumberSequenceKeypoint struct {
Time, Value, Envelope float32
}
type ValuePhysicalProperties ¶
type ValuePhysicalProperties struct { CustomPhysics byte Density float32 Friction float32 Elasticity float32 FrictionWeight float32 ElasticityWeight float32 }
func (*ValuePhysicalProperties) ArrayBytes ¶
func (v *ValuePhysicalProperties) ArrayBytes(a []Value) (b []byte, err error)
func (ValuePhysicalProperties) Bytes ¶
func (v ValuePhysicalProperties) Bytes() []byte
func (ValuePhysicalProperties) FromArrayBytes ¶
func (v ValuePhysicalProperties) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValuePhysicalProperties) FromBytes ¶
func (v *ValuePhysicalProperties) FromBytes(b []byte) error
func (ValuePhysicalProperties) Type ¶
func (ValuePhysicalProperties) Type() Type
type ValueRay ¶
type ValueRect2D ¶
type ValueRect2D struct {
Min, Max ValueVector2
}
func (ValueRect2D) ArrayBytes ¶
func (v ValueRect2D) ArrayBytes(a []Value) (b []byte, err error)
func (ValueRect2D) Bytes ¶
func (v ValueRect2D) Bytes() []byte
func (ValueRect2D) FromArrayBytes ¶
func (v ValueRect2D) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueRect2D) FromBytes ¶
func (v *ValueRect2D) FromBytes(b []byte) error
func (ValueRect2D) Type ¶
func (ValueRect2D) Type() Type
type ValueReference ¶
type ValueReference int32
func (*ValueReference) ArrayBytes ¶
func (v *ValueReference) ArrayBytes(a []Value) (b []byte, err error)
func (ValueReference) Bytes ¶
func (v ValueReference) Bytes() []byte
func (ValueReference) FromArrayBytes ¶
func (v ValueReference) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueReference) FromBytes ¶
func (v *ValueReference) FromBytes(b []byte) error
func (ValueReference) Type ¶
func (ValueReference) Type() Type
type ValueSharedString ¶
type ValueSharedString uint32
func (*ValueSharedString) ArrayBytes ¶
func (v *ValueSharedString) ArrayBytes(a []Value) (b []byte, err error)
func (ValueSharedString) Bytes ¶
func (v ValueSharedString) Bytes() []byte
func (ValueSharedString) FromArrayBytes ¶
func (v ValueSharedString) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueSharedString) FromBytes ¶
func (v *ValueSharedString) FromBytes(b []byte) error
func (ValueSharedString) Type ¶
func (ValueSharedString) Type() Type
type ValueString ¶
type ValueString []byte
func (*ValueString) ArrayBytes ¶
func (v *ValueString) ArrayBytes(a []Value) (b []byte, err error)
func (ValueString) Bytes ¶
func (v ValueString) Bytes() []byte
func (ValueString) FromArrayBytes ¶
func (v ValueString) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueString) FromBytes ¶
func (v *ValueString) FromBytes(b []byte) error
func (ValueString) Type ¶
func (ValueString) Type() Type
type ValueToken ¶
type ValueToken uint32
func (*ValueToken) ArrayBytes ¶
func (v *ValueToken) ArrayBytes(a []Value) (b []byte, err error)
func (ValueToken) Bytes ¶
func (v ValueToken) Bytes() []byte
func (ValueToken) FromArrayBytes ¶
func (v ValueToken) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueToken) FromBytes ¶
func (v *ValueToken) FromBytes(b []byte) error
func (ValueToken) Type ¶
func (ValueToken) Type() Type
type ValueUDim ¶
type ValueUDim struct { Scale ValueFloat Offset ValueInt }
func (ValueUDim) FromArrayBytes ¶
type ValueUDim2 ¶
type ValueUDim2 struct { ScaleX ValueFloat ScaleY ValueFloat OffsetX ValueInt OffsetY ValueInt }
func (ValueUDim2) ArrayBytes ¶
func (v ValueUDim2) ArrayBytes(a []Value) (b []byte, err error)
func (ValueUDim2) Bytes ¶
func (v ValueUDim2) Bytes() []byte
func (ValueUDim2) FromArrayBytes ¶
func (v ValueUDim2) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueUDim2) FromBytes ¶
func (v *ValueUDim2) FromBytes(b []byte) error
func (ValueUDim2) Type ¶
func (ValueUDim2) Type() Type
type ValueVector2 ¶
type ValueVector2 struct {
X, Y ValueFloat
}
func (ValueVector2) ArrayBytes ¶
func (v ValueVector2) ArrayBytes(a []Value) (b []byte, err error)
func (ValueVector2) Bytes ¶
func (v ValueVector2) Bytes() []byte
func (ValueVector2) FromArrayBytes ¶
func (v ValueVector2) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueVector2) FromBytes ¶
func (v *ValueVector2) FromBytes(b []byte) error
func (ValueVector2) Type ¶
func (ValueVector2) Type() Type
type ValueVector2int16 ¶
type ValueVector2int16 struct {
X, Y int16
}
func (*ValueVector2int16) ArrayBytes ¶
func (v *ValueVector2int16) ArrayBytes(a []Value) (b []byte, err error)
func (ValueVector2int16) Bytes ¶
func (v ValueVector2int16) Bytes() []byte
func (ValueVector2int16) FromArrayBytes ¶
func (v ValueVector2int16) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueVector2int16) FromBytes ¶
func (v *ValueVector2int16) FromBytes(b []byte) error
func (ValueVector2int16) Type ¶
func (ValueVector2int16) Type() Type
type ValueVector3 ¶
type ValueVector3 struct {
X, Y, Z ValueFloat
}
func (ValueVector3) ArrayBytes ¶
func (v ValueVector3) ArrayBytes(a []Value) (b []byte, err error)
func (ValueVector3) Bytes ¶
func (v ValueVector3) Bytes() []byte
func (ValueVector3) FromArrayBytes ¶
func (v ValueVector3) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueVector3) FromBytes ¶
func (v *ValueVector3) FromBytes(b []byte) error
func (ValueVector3) Type ¶
func (ValueVector3) Type() Type
type ValueVector3int16 ¶
type ValueVector3int16 struct {
X, Y, Z int16
}
func (*ValueVector3int16) ArrayBytes ¶
func (v *ValueVector3int16) ArrayBytes(a []Value) (b []byte, err error)
func (ValueVector3int16) Bytes ¶
func (v ValueVector3int16) Bytes() []byte
func (ValueVector3int16) FromArrayBytes ¶
func (v ValueVector3int16) FromArrayBytes(b []byte) (a []Value, err error)
func (*ValueVector3int16) FromBytes ¶
func (v *ValueVector3int16) FromBytes(b []byte) error
func (ValueVector3int16) Type ¶
func (ValueVector3int16) Type() Type