rtypes

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SkipChildren = errors.New("skip children")

SkipChildren causes Instance.ForEachDescendant to skip iterating an instance's children.

Functions

func Intable added in v0.5.0

func Intable(v interface{}) (i int64, ok bool)

Intable returns Value as an integer. ok is false if the value could not be converted. Types that can be converted are the built-in numeric types, as well as any value implementing types.Intlike or types.Numberlike.

func Numberable added in v0.5.0

func Numberable(v interface{}) (n float64, ok bool)

Numberable returns v as a floating-point number. ok is false if the value could not be converted. Types that can be converted are the built-in numeric types, as well as any value implementing types.Numberlike or types.Intlike.

func Stringable added in v0.5.0

func Stringable(v interface{}) (s string, ok bool)

Stringable returns v as a string. ok is false if the value could not be converted. Types that can be converted are the built-in string, []byte, and []rune, as well as any value implementing types.Stringlike.

Additionally, an Instance can be converted if it has a particular ClassName, and a selected property implements types.Stringlike:

ClassName         | Property
------------------|---------
LocalizationTable | Contents
LocalScript       | Source
ModuleScript      | Source
Script            | Source

Types

type Array

type Array []types.Value

Array is a list of types.Values that itself implements types.Value. It corresponds to the Array type in Roblox.

func (Array) Type

func (Array) Type() string

Type returns a string identifying the type of the value.

type AttrConfig added in v0.4.0

type AttrConfig struct {
	// Property is the name of the property to which attributes will be
	// serialized. An empty string defaults to "AttributesSerialize".
	Property string
}

AttrConfig configures an Instance's attributes API.

func (*AttrConfig) Of added in v0.6.0

func (a *AttrConfig) Of(inst *Instance) *AttrConfig

Of returns the AttrConfig of an instance. If inst is nil, a is returned.

func (*AttrConfig) String added in v0.4.0

func (*AttrConfig) String() string

String returns a string representation of the value.

func (*AttrConfig) Type added in v0.4.0

func (*AttrConfig) Type() string

Type returns a string identifying the type of the value.

type CallbackDesc

type CallbackDesc rbxdump.Callback

CallbackDesc wraps a rbxdump.Callback to implement types.Value.

func (CallbackDesc) Type

func (CallbackDesc) Type() string

Type returns a string identifying the type of the value.

type ClassDesc

type ClassDesc rbxdump.Class

ClassDesc wraps a rbxdump.Class to implement types.Value.

func (ClassDesc) Type

func (ClassDesc) Type() string

Type returns a string identifying the type of the value.

type Color3uint8

type Color3uint8 types.Color3

Color3uint8 wraps a Color3 value to be interpreted as the Color3uint8 Roblox type.

func (Color3uint8) Alias

func (c Color3uint8) Alias() types.Value

Alias returns the underlying Color3 value.

func (Color3uint8) Copy

func (c Color3uint8) Copy() types.PropValue

Copy returns a copy of the value.

func (Color3uint8) String

func (c Color3uint8) String() string

String returns a string representation of the value.

func (Color3uint8) Type

func (Color3uint8) Type() string

Type returns a string indicating the type of the value.

type Cookie struct {
	*http.Cookie
}

func (Cookie) String added in v0.5.0

func (c Cookie) String() string

String returns a string representation of the value.

func (Cookie) Type added in v0.5.0

func (Cookie) Type() string

Type returns a string identifying the type of the value.

type Cookies added in v0.5.0

type Cookies []Cookie

func (Cookies) Type added in v0.5.0

func (Cookies) Type() string

Type returns a string identifying the type of the value.

type DescAction

type DescAction struct {
	diff.Action
}

DescAction wraps a diff.Action to implement types.Value.

func (*DescAction) String

func (a *DescAction) String() string

String returns a string representation of the value.

func (*DescAction) Type

func (*DescAction) Type() string

Type returns a string identifying the type of the value.

type DescActions

type DescActions []*DescAction

DescActions is a list of DescAction values that implements types.Value.

func (DescActions) Type

func (DescActions) Type() string

Type returns a string identifying the type of the value.

type DescFields added in v0.8.0

type DescFields rbxdump.Fields

DescFields wraps a rbxdump.Fields to implement types.Value.

func (DescFields) Type added in v0.8.0

func (DescFields) Type() string

Type returns a string identifying the type of the value.

type Dictionary

type Dictionary map[string]types.Value

Dictionary is a collection of strings mapping to types.Values, that itself implements a types.Value. It corresponds to the Dictionary type in Roblox.

func (Dictionary) Type

func (Dictionary) Type() string

Type returns a string identifying the type of the value.

type Enum

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

Enum contains a set of named values.

func NewEnum

func NewEnum(name string, items ...NewItem) *Enum

NewEnum defines a an immutable enum.

func (*Enum) Item

func (e *Enum) Item(name string) *EnumItem

Item returns the enum item corresponding to the given name, or nil if no such item exists.

func (*Enum) Items

func (e *Enum) Items() []*EnumItem

Items returns the items of the enum in a list.

func (*Enum) Name

func (e *Enum) Name() string

Name returns the name of the enum.

func (*Enum) Pull added in v0.6.0

func (e *Enum) Pull(lv lua.LValue) *EnumItem

Pull attempts to convert a Lua value to an item of the enum. Returns nil if the value could not be converted.

A value is converted if it is a number that matches the value of an item, if it is a string that matches the name of an item, or if it is an EnumItem userdata that is an item of the enum.

func (*Enum) String

func (e *Enum) String() string

String returns a string representation of the value.

func (*Enum) Type

func (*Enum) Type() string

Type returns a string identifying the type of the value.

func (*Enum) Value

func (e *Enum) Value(value int) *EnumItem

Value returns the enum item corresponding to the given value, or nil if no such item exists.

type EnumDesc

type EnumDesc rbxdump.Enum

EnumDesc wraps a rbxdump.Enum to implement types.Value.

func (EnumDesc) Type

func (EnumDesc) Type() string

Type returns a string identifying the type of the value.

type EnumItem

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

EnumItem represents one possible value of an enum.

func (*EnumItem) Enum

func (e *EnumItem) Enum() *Enum

Enum returns the enum to which the item belongs.

func (*EnumItem) Name

func (e *EnumItem) Name() string

Name returns the name of the item.

func (*EnumItem) String

func (e *EnumItem) String() string

String returns a string representation of the value.

func (*EnumItem) Type

func (*EnumItem) Type() string

Type returns a string identifying the type of the value.

func (*EnumItem) Value

func (e *EnumItem) Value() int

Value returns the value of the item.

type EnumItemDesc

type EnumItemDesc rbxdump.EnumItem

EnumItemDesc wraps a rbxdump.EnumItem to implement types.Value.

func (EnumItemDesc) Type

func (EnumItemDesc) Type() string

Type returns a string identifying the type of the value.

type Enums

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

Enums is a collection of Enum values.

func NewEnums

func NewEnums(enums ...*Enum) *Enums

NewEnums creates an immutable collection of enums.

func (*Enums) Enum

func (e *Enums) Enum(name string) *Enum

Enum returns the Enum corresponding to the given name, or nil if no such enum was found.

func (*Enums) Enums

func (e *Enums) Enums() []*Enum

Enum returns the enums in the collection as a list.

func (*Enums) Include added in v0.8.0

func (e *Enums) Include(enums ...*Enum)

Include adds the given Enum values to the collection.

func (*Enums) String

func (*Enums) String() string

String returns a string representation of the value.

func (*Enums) Type

func (*Enums) Type() string

Type returns a string identifying the type of the value.

type EventDesc

type EventDesc rbxdump.Event

EventDesc wraps a rbxdump.Event to implement types.Value.

func (EventDesc) Type

func (EventDesc) Type() string

Type returns a string identifying the type of the value.

type FormatSelector added in v0.4.0

type FormatSelector struct {
	Format  string
	Options Dictionary
}

FormatSelector selects a format and provides options for configuring the format.

func (FormatSelector) String added in v0.4.0

func (f FormatSelector) String() string

String returns a string representation of the value.

func (FormatSelector) Type added in v0.4.0

func (FormatSelector) Type() string

Type returns a string identifying the type of the value.

func (FormatSelector) ValueOf added in v0.4.0

func (f FormatSelector) ValueOf(field string) types.Value

ValueOf returns the value of field. Returns nil if the value does not exist.

type FunctionDesc

type FunctionDesc rbxdump.Function

FunctionDesc wraps a rbxdump.Function to implement types.Value.

func (FunctionDesc) Type

func (FunctionDesc) Type() string

Type returns a string identifying the type of the value.

type HTTPHeaders added in v0.4.0

type HTTPHeaders http.Header

HTTPHeaders contains the headers of an HTTP request or response.

func (HTTPHeaders) AppendCookies added in v0.5.0

func (h HTTPHeaders) AppendCookies(c Cookies) HTTPHeaders

AppendCookie formats and adds the given cookies to the Cookie header.

func (HTTPHeaders) AppendSetCookies added in v0.5.0

func (h HTTPHeaders) AppendSetCookies(c Cookies) HTTPHeaders

AppendSetCookie formats and adds the given cookies to the Set-Cookie header.

func (HTTPHeaders) RetrieveCookies added in v0.5.0

func (h HTTPHeaders) RetrieveCookies() Cookies

RetrieveCookies parses the Cookie header.

func (HTTPHeaders) RetrieveSetCookies added in v0.5.0

func (h HTTPHeaders) RetrieveSetCookies() Cookies

RetrieveSetCookies parses the Set-Cookie header.

func (HTTPHeaders) Type added in v0.4.0

func (HTTPHeaders) Type() string

Type returns a string identifying the type of the value.

type HTTPOptions added in v0.4.0

type HTTPOptions struct {
	URL            string
	Method         string
	RequestFormat  FormatSelector
	ResponseFormat FormatSelector
	Headers        HTTPHeaders
	Cookies        Cookies
	Body           types.Value
}

HTTPOptions specifies options to an HTTP request.

func (HTTPOptions) Type added in v0.4.0

func (HTTPOptions) Type() string

Type returns a string identifying the type of the value.

type HTTPResponse added in v0.4.0

type HTTPResponse struct {
	Success       bool
	StatusCode    int
	StatusMessage string
	Headers       HTTPHeaders
	Cookies       Cookies
	Body          types.Value
}

HTTPResponse contains the response to an HTTP request.

func (HTTPResponse) Type added in v0.4.0

func (HTTPResponse) Type() string

Type returns a string identifying the type of the value.

type Instance

type Instance struct {
	ClassName string
	Reference string
	IsService bool
	// contains filtered or unexported fields
}

Instance contains data describing an instance of a particular class. It corresponds to the Instance type in Roblox.

func NewDataModel

func NewDataModel() *Instance

NewDataModel returns a special Instance of the DataModel class, to be used as the root of a tree of instances.

func NewInstance

func NewInstance(className string, parent *Instance) *Instance

NewInstance returns a new Instance of the given class name. Optionally, parent sets the Parent of the instance.

func (*Instance) AddChild

func (inst *Instance) AddChild(child *Instance) error

AddChild appends a child instance to the instance's list of children. If the child has a parent, it is first removed. The parent of the child is set to the instance. An error is returned if the instance is a descendant of the child, or if the child is the instance itself.

func (*Instance) AddChildAt

func (inst *Instance) AddChildAt(index int, child *Instance) error

AddChildAt inserts a child instance into the instance's list of children at a given position. If the child has a parent, it is first removed. The parent of the child is set to the instance. If the index is outside the bounds of the list, then it is constrained. An error is returned if the instance is a descendant of the child, or if the child is the instance itself.

func (*Instance) AttrConfig added in v0.4.0

func (inst *Instance) AttrConfig() *AttrConfig

AttrConfig returns the nearest AttrConfig for the instance. If the AttrConfig of current instance is nil, then the parent is searched, and so on, until a non-nil or blocked AttrConfig is found. Nil is returned if no Attrs are found.

func (*Instance) Children

func (inst *Instance) Children() []*Instance

Children returns the children of the instance in a list.

func (*Instance) Clone

func (inst *Instance) Clone() *Instance

Clone returns a copy of the instance. Each property and all descendants are copied as well. Unlike Roblox's implementation, the Archivable property is ignored.

A copied reference within the tree is resolved so that it points to the corresponding copy of the original referent. Copied references that point to an instance which isn't being copied will still point to the same instance.

func (*Instance) Copy

func (inst *Instance) Copy() types.PropValue

Copy is an alias for Clone that allows Instance to implement types.PropValue.

func (*Instance) Desc

func (inst *Instance) Desc() *RootDesc

Desc returns the nearest root descriptor for the instance. If the descriptor of current instance is nil, then the parent is searched, and so on, until a non-nil or blocked descriptor is found. Nil is returned if no descriptors are found.

func (*Instance) Descend added in v0.6.0

func (inst *Instance) Descend(names ...string) *Instance

Descend returns a descendant of the instance by recursively searching for each name in succession according to FindFirstChild. Returns the instance itself if no arguments are given. Returns nil if a child could not be found.

func (*Instance) Descendants

func (inst *Instance) Descendants() []*Instance

Descendants returns the descendants of the instance in a list.

func (*Instance) FindFirstAncestor

func (inst *Instance) FindFirstAncestor(name string) *Instance

FindFirstAncestor returns the nearest ancestor of the instance that matches the given name, or nil if no such instance was found.

func (*Instance) FindFirstAncestorOfClass

func (inst *Instance) FindFirstAncestorOfClass(class string) *Instance

FindFirstAncestorOfClass returns the nearest ancestor of the instance that matches the given class name, or nil if no such instance was found.

func (*Instance) FindFirstAncestorWhichIsA added in v0.4.0

func (inst *Instance) FindFirstAncestorWhichIsA(class string) *Instance

FindFirstAncestorWhichIsA returns the nearest ancestor of the instance that inherits from the given class name, or nil if no such instance was found. If an instance has no descriptor, then only its ClassName is compared.

func (*Instance) FindFirstChild

func (inst *Instance) FindFirstChild(name string, recurse bool) *Instance

FindFirstChild returns the first child instance of the given name. If recurse is true, then descendants will also be searched top-down.

func (*Instance) FindFirstChildOfClass

func (inst *Instance) FindFirstChildOfClass(class string, recurse bool) *Instance

FindFirstChildOfClass returns the first child instance of the given class name. If recurse is true, then descendants will also be searched top-down.

func (*Instance) FindFirstChildWhichIsA added in v0.4.0

func (inst *Instance) FindFirstChildWhichIsA(class string, recurse bool) *Instance

FindFirstChildWhichIsA returns the first child instance that inherits from the given class name. If recurse is true, then descendants will also be searched top-down. If an instance has no descriptor, then only its ClassName is compared.

func (*Instance) ForEachChild added in v0.6.0

func (inst *Instance) ForEachChild(cb func(child *Instance) error) error

ForEachChild iterates over each child of the instance.

If cb returns an error, iteration stops, and the error is returned.

func (*Instance) ForEachDescendant added in v0.6.0

func (inst *Instance) ForEachDescendant(cb func(desc *Instance) error) error

ForEachDescendant iterates over each descendant of the instance, depth-first.

If cb returns SkipChildren, then the method moves to the next sibling of desc without visiting the children of desc.

Otherwise, if cb returns an error, iteration stops, and the error is returned.

func (*Instance) ForEachProperty added in v0.6.0

func (inst *Instance) ForEachProperty(cb func(name string, value types.PropValue) error) error

ForEachProperty iterates over each property of the instance.

The order in which properties are visited is undefined.

If cb returns an error, iteration stops, and the error is returned.

func (*Instance) Get

func (inst *Instance) Get(property string) (value types.PropValue)

Get returns the value of a property in the instance. The value will be nil if the property is not defined.

If property is "ClassName", then the ClassName field is returned as a types.String.

If property is "Parent", then the result of the Parent method is returned.

func (*Instance) GetFullName

func (inst *Instance) GetFullName() string

GetFullName returns the "full" name of the instance, which is the combined names of the instance and every ancestor, separated by a `.` character.

func (*Instance) IsA added in v0.4.0

func (inst *Instance) IsA(className string) bool

IsA returns whether the instance's class inherits from className. If the instance has no descriptor, then only its ClassName is compared.

func (*Instance) IsAncestorOf

func (inst *Instance) IsAncestorOf(descendant *Instance) bool

IsAncestorOf returns whether the instance is the ancestor of another instance.

func (*Instance) IsDataModel

func (inst *Instance) IsDataModel() bool

IsDataModel returns whether the instance is a root DataModel.

func (*Instance) IsDescendantOf

func (inst *Instance) IsDescendantOf(ancestor *Instance) bool

IsDescendantOf returns whether the instance is the descendant of another instance.

func (*Instance) Metadata added in v0.5.0

func (inst *Instance) Metadata() map[string]string

Metadata returns the metadata of a DataModel. Returns nil if the Instance is not a DataModel.

func (*Instance) Name

func (inst *Instance) Name() string

Name returns the Name property of the instance, or an empty string if it is invalid or not defined.

func (*Instance) Parent

func (inst *Instance) Parent() *Instance

Parent returns the parent of the instance. Returns nil if the instance has no parent.

func (*Instance) Properties

func (inst *Instance) Properties() map[string]types.PropValue

Properties returns the properties of the instance as names mapped to values.

ClassName and Parent are not included.

func (*Instance) PropertyNames added in v0.7.0

func (inst *Instance) PropertyNames() []string

PropertyNames returns a list of names of properties set on the instance.

func (*Instance) RawAttrConfig added in v0.4.0

func (inst *Instance) RawAttrConfig() (attrcfg *AttrConfig, blocked bool)

RawAttrConfig returns the AttrConfig for the instance, and whether it is blocked.

func (*Instance) RawDesc

func (inst *Instance) RawDesc() (desc *RootDesc, blocked bool)

RawDesc returns the root descriptor for the instance, and whether it is blocked.

func (*Instance) RemoveAll

func (inst *Instance) RemoveAll()

RemoveAll remove every child from the instance. The parent of each child is set to nil.

func (*Instance) RemoveChild

func (inst *Instance) RemoveChild(child *Instance) *Instance

RemoveChild removes a child instance from the instance's list of children. The parent of the child is set to nil. Returns the removed child.

func (*Instance) RemoveChildAt

func (inst *Instance) RemoveChildAt(index int) *Instance

RemoveChildAt removes the child at a given position from the instance's list of children. The parent of the child is set to nil. If the index is outside the bounds of the list, then no children are removed. Returns the removed child.

func (*Instance) RemoveChildAtFast

func (inst *Instance) RemoveChildAtFast(index int) *Instance

RemoveChildAtFast is like RemoveChildAt, but does not preserve the order of children.

func (*Instance) RemoveChildFast

func (inst *Instance) RemoveChildFast(child *Instance) *Instance

RemoveChildFast is like RemoveChild, but does not preserve the order of children.

func (*Instance) Set

func (inst *Instance) Set(property string, value types.PropValue)

Set sets the value of a property in the instance. If value is nil, then the value will be deleted from the Properties map.

If property is "ClassName", then the ClassName field is set. Set panics if value does not implement types.Stringlike.

If property is "Parent", then the SetParent method is called. Set panics if value is not an *Instance or nil, or if SetParent returns an error.

func (*Instance) SetAttrConfig added in v0.4.0

func (inst *Instance) SetAttrConfig(attrcfg *AttrConfig, blocked bool)

SetAttrConfig sets attrcfg as the AttrConfig for the instance. If blocked is true, then the AttrConfig is set to nil, and AttrConfig will return nil if it reaches the instance.

func (*Instance) SetDesc

func (inst *Instance) SetDesc(root *RootDesc, blocked bool)

SetDesc sets root as the root descriptor for the instance. If blocked is true, then the root descriptor is set to nil, and Desc will return nil if it reaches the instance.

func (*Instance) SetName

func (inst *Instance) SetName(name string)

SetName sets the Name property of the instance.

func (*Instance) SetParent

func (inst *Instance) SetParent(parent *Instance) error

SetParent sets the parent of the instance, removing itself from the children of the old parent, and adding itself as a child of the new parent. The parent can be set to nil. An error is returned if the parent is a descendant of the instance, or if the parent is the instance itself. If the new parent is the same as the old parent, then the position of the instance in the parent's children is unchanged.

func (*Instance) SetProperties added in v0.7.0

func (inst *Instance) SetProperties(props map[string]types.PropValue, replace bool)

SetProperties replaces the properties of the instance with props. Each entry in props is a property name mapped to a value. ClassName and Parent are ignored.

If replace is true, then properties in the instance that are nil in props are removed. If false, such properties are retained. If props is nil or empty, and replace is true, then all properties are removed from the instance.

func (*Instance) String

func (inst *Instance) String() string

String returns a string representation of the instance by returning the Name, or the ClassName if Name isn't defined.

func (*Instance) Type

func (*Instance) Type() string

Type returns a string identifying the type of the value.

func (*Instance) WithDescFindFirstAncestorWhichIsA added in v0.6.0

func (inst *Instance) WithDescFindFirstAncestorWhichIsA(globalDesc *RootDesc, class string) *Instance

WithDescFindFirstAncestorWhichIsA is like FindFirstAncestorWhichIsA, but includes a global descriptor.

func (*Instance) WithDescFindFirstChildWhichIsA added in v0.6.0

func (inst *Instance) WithDescFindFirstChildWhichIsA(globalDesc *RootDesc, class string, recurse bool) *Instance

WithDescFindFirstChildWhichIsA is like FindFirstChildWhichIsA, but includes a global descriptor.

func (*Instance) WithDescIsA added in v0.6.0

func (inst *Instance) WithDescIsA(globalDesc *RootDesc, className string) bool

WithDescIsA is like IsA, but includes a global descriptor.

type MemberDesc added in v0.8.0

type MemberDesc struct {
	rbxdump.Member
}

MemberDesc wraps a rbxdump.Member to implement types.Value.

func (MemberDesc) Type added in v0.8.0

func (MemberDesc) Type() string

Type returns a string identifying the type of the value.

type NewItem

type NewItem struct {
	Name  string
	Value int
}

NewItem is passed to NewEnum to define an item of the enum.

type NilType

type NilType struct{}

NilType represents a nil value that implements types.Value.

var Nil NilType

Nil is a value of NilType.

func (NilType) String

func (NilType) String() string

String returns a string representation of the value.

func (NilType) Type

func (NilType) Type() string

Type returns a string identifying the type of the value.

type Objects

type Objects []*Instance

Objects is a list of Instances that implements types.Value. It corresponds to the Objects type in Roblox.

func (Objects) Type

func (Objects) Type() string

Type returns a string identifying the type of the value.

type Optional added in v0.9.0

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

Optional is a types.Value that may have some value, or none.

func None added in v0.9.0

func None(t string) Optional

None returns an Optional with type t and no value.

func Some added in v0.9.0

func Some(value types.Value) Optional

Some returns an Optional with the given value and value's type.

func (Optional) Alias added in v0.9.0

func (o Optional) Alias() types.Value

Alias returns the underlying value.

func (Optional) Copy added in v0.9.0

func (t Optional) Copy() types.PropValue

Copy returns a copy of the Optional. If the underlying value does not implement PropValue, then None is returned.

func (*Optional) None added in v0.9.0

func (o *Optional) None(t string) Optional

None sets the option to have type t with no value.

func (*Optional) Some added in v0.9.0

func (o *Optional) Some(value types.Value) Optional

Some sets the option to have the given value and value's type.

func (Optional) Type added in v0.9.0

func (o Optional) Type() string

func (Optional) Value added in v0.9.0

func (o Optional) Value() types.Value

Value returns the value of the option, or nil if the option has no value.

func (Optional) ValueType added in v0.9.0

func (o Optional) ValueType() string

ValueType returns the the value type of the option.

type ParameterDesc

type ParameterDesc struct {
	rbxdump.Parameter
}

ParameterDesc wraps a rbxdump.Parameter to implement types.Value.

func (ParameterDesc) Type

func (ParameterDesc) Type() string

Type returns a string identifying the type of the value.

type PropertyDesc

type PropertyDesc rbxdump.Property

PropertyDesc wraps a rbxdump.Property to implement types.Value.

func (PropertyDesc) Type

func (PropertyDesc) Type() string

Type returns a string identifying the type of the value.

type RBXAssetOptions added in v0.5.0

type RBXAssetOptions struct {
	AssetID int64
	Cookies Cookies
	Format  FormatSelector
	Body    types.Value
}

RBXAssetOptions specifies options to a Roblox web request.

func (RBXAssetOptions) Type added in v0.5.0

func (RBXAssetOptions) Type() string

Type returns a string identifying the type of the value.

type RootDesc

type RootDesc struct {
	*rbxdump.Root
	EnumTypes *Enums
}

RootDesc wraps a rbxdump.Root to implement types.Value.

func (*RootDesc) Class added in v0.8.0

func (d *RootDesc) Class(name string) (class *rbxdump.Class)

Class returns the class descriptor from a class name. Returns nil if d is nil, or the class was not found.

func (*RootDesc) ClassIsA added in v0.8.0

func (d *RootDesc) ClassIsA(class, superclass string) bool

ClassIsA returns whether class is a subclass of superclass. Returns false if d is nil, or if class or superclass are not valid classes.

func (*RootDesc) Copy added in v0.9.0

func (d *RootDesc) Copy() *RootDesc

func (*RootDesc) Enum added in v0.8.0

func (d *RootDesc) Enum(name string) (enum *rbxdump.Enum)

Enum returns the enum descriptor from an enum name. Returns nil if d is nil, or the enum was not found.

func (*RootDesc) EnumItem added in v0.8.0

func (d *RootDesc) EnumItem(enum, name string) (item *rbxdump.EnumItem)

EnumItem returns the enum item descriptor from an enum and item name. Returns nil if d is nil, or the enum or item was not found.

func (*RootDesc) GenerateEnumTypes

func (d *RootDesc) GenerateEnumTypes()

GenerateEnumTypes sets EnumTypes to a collection of enum values generated from the root's enum descriptors.

func (*RootDesc) Member

func (d *RootDesc) Member(class, name string) (member rbxdump.Member)

Member gets a member descriptor from a class, or any class it inherits from. Returns nil if d is nil, or if the class or member was not found.

func (*RootDesc) Of added in v0.6.0

func (d *RootDesc) Of(inst *Instance) *RootDesc

Of returns the root descriptor of an instance. If inst is nil, r is returned.

func (*RootDesc) Property

func (d *RootDesc) Property(class, name string) *rbxdump.Property

Property gets a property descriptor from a class, or any class it inherits from. Returns nil if d is nil, or if the class or member was not found.

func (*RootDesc) String

func (d *RootDesc) String() string

String returns a string representation of the value.

func (*RootDesc) Type

func (*RootDesc) Type() string

Type returns a string identifying the type of the value.

type Symbol

type Symbol struct {
	Name string
}

Symbol is a unique identifier used for accessing members.

func (Symbol) String

func (s Symbol) String() string

String returns a string representation of the value.

func (Symbol) Type

func (Symbol) Type() string

Type returns a string identifying the type of the value.

type Table

type Table struct {
	*lua.LTable
}

Table wraps a Lua table to implement types.Value.

func (Table) String

func (t Table) String() string

String returns a string representation of the value.

func (Table) Type

func (Table) Type() string

Type returns a string identifying the type of the value.

type Tuple

type Tuple []types.Value

Tuple is a sequence of types.Values that itself implements types.Value. It corresponds to the Tuple type in Roblox.

func (Tuple) Type

func (Tuple) Type() string

Type returns a string identifying the type of the value.

type TypeDesc

type TypeDesc struct {
	Embedded rbxdump.Type
}

TypeDesc wraps a rbxdump.Type to implement types.Value.

func (TypeDesc) Type

func (TypeDesc) Type() string

Type returns a string identifying the type of the value.

type UniqueId added in v0.9.0

type UniqueId struct {
	Random types.Int64
	Time   uint32
	Index  uint32
}

UniqueId represents a unique identifier.

func (UniqueId) Copy added in v0.9.0

func (u UniqueId) Copy() types.PropValue

Copy returns a copy of the value.

func (UniqueId) String added in v0.9.0

func (u UniqueId) String() string

String returns a string representation of the value.

func (UniqueId) Type added in v0.9.0

func (UniqueId) Type() string

Type returns a string identifying the type of the value.

Jump to

Keyboard shortcuts

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