Documentation ¶
Index ¶
- Constants
- Variables
- func TypeString(val rbxfile.Value) string
- type DataModel
- func (model *DataModel) AddService(service *Instance)
- func (model *DataModel) Copy() *DataModel
- func (model *DataModel) FindService(name string) *Instance
- func (model *DataModel) ToRbxfile() *rbxfile.Root
- func (model *DataModel) WaitForChild(ctx context.Context, names ...string) (*Instance, error)
- func (model *DataModel) WaitForService(ctx context.Context, name string) (*Instance, error)
- type Instance
- func (instance *Instance) AddChild(child *Instance) error
- func (instance *Instance) Copy(pool *SelfReferencePool) *Instance
- func (instance *Instance) FindFirstChild(name string) *Instance
- func (instance *Instance) FireEvent(name string, args ...rbxfile.Value)
- func (instance *Instance) Get(name string) rbxfile.Value
- func (instance *Instance) GetFullName() string
- func (instance *Instance) HasAncestor(ancestor *Instance) bool
- func (instance *Instance) Name() string
- func (instance *Instance) Parent() *Instance
- func (instance *Instance) Set(name string, value rbxfile.Value)
- func (instance *Instance) SetParent(parent *Instance) error
- func (instance *Instance) ToRbxfile(pool *RbxfileReferencePool) *rbxfile.Instance
- func (instance *Instance) WaitForChild(ctx context.Context, names ...string) (*Instance, error)
- func (instance *Instance) WaitForProp(ctx context.Context, name string) (rbxfile.Value, error)
- func (instance *Instance) WaitForRefProp(ctx context.Context, name string) (*Instance, error)
- type InstanceDictionary
- type InstanceList
- type RbxfileReferencePool
- type Reference
- type SelfReferencePool
- type ValueArray
- type ValueColorSequence
- type ValueColorSequenceKeypoint
- type ValueDeferredString
- type ValueDictionary
- type ValueMap
- type ValueNumberSequence
- type ValueNumberSequenceKeypoint
- type ValuePathWaypoint
- type ValueReference
- type ValueRegion3
- type ValueRegion3int16
- type ValueSystemAddress
- type ValueToken
- type ValueTuple
- type ValueVector3int32
Constants ¶
const ( TypeNumberSequenceKeypoint rbxfile.Type = rbxfile.TypeSharedString + 1 + iota TypeColorSequenceKeypoint = rbxfile.TypeSharedString + 1 + iota TypeNumberSequence = rbxfile.TypeSharedString + 1 + iota TypeColorSequence = rbxfile.TypeSharedString + 1 + iota TypeSystemAddress = rbxfile.TypeSharedString + 1 + iota TypeMap = rbxfile.TypeSharedString + 1 + iota TypeDictionary = rbxfile.TypeSharedString + 1 + iota TypeArray = rbxfile.TypeSharedString + 1 + iota TypeTuple = rbxfile.TypeSharedString + 1 + iota TypeRegion3 = rbxfile.TypeSharedString + 1 + iota TypeRegion3int16 = rbxfile.TypeSharedString + 1 + iota TypeReference = rbxfile.TypeSharedString + 1 + iota TypeToken = rbxfile.TypeSharedString + 1 + iota // used for terrain TypeVector3int32 = rbxfile.TypeSharedString + 1 + iota TypePathWaypoint = rbxfile.TypeSharedString + 1 + iota TypeDeferredString = rbxfile.TypeSharedString + 1 + iota )
Variables ¶
var CustomTypeNames = map[rbxfile.Type]string{ TypeNumberSequenceKeypoint: "NumberSequenceKeypoint", TypeColorSequenceKeypoint: "ColorSequenceKeypoint", TypeNumberSequence: "NumberSequence", TypeColorSequence: "ColorSequence", TypeSystemAddress: "SystemAddress", TypeMap: "Map", TypeDictionary: "Dictionary", TypeArray: "Array", TypeTuple: "Tuple", TypeRegion3: "Region3", TypeRegion3int16: "Region3int16", TypeReference: "Reference", TypeToken: "Token", TypeVector3int32: "Vector3int32", TypePathWaypoint: "PathWaypoint", TypeDeferredString: "SharedString (deferred)", }
var ErrInstanceDoesntExist = errors.New("instance doesn't exist")
var ErrNullInstance = errors.New("instance is null")
var NullReference = Reference{ IsNull: true, Scope: "null", }
Functions ¶
func TypeString ¶
Types ¶
type DataModel ¶
func FromRbxfile ¶
func FromRbxfile(dictionary *InstanceDictionary, root *rbxfile.Root) *DataModel
func (*DataModel) AddService ¶
func (*DataModel) FindService ¶
func (*DataModel) WaitForChild ¶
type Instance ¶
type Instance struct { ClassName string PropertiesMutex *sync.RWMutex Properties map[string]rbxfile.Value Children []*Instance IsService bool Ref Reference ChildEmitter *emitter.Emitter PropertyEmitter *emitter.Emitter EventEmitter *emitter.Emitter ParentEmitter *emitter.Emitter // contains filtered or unexported fields }
func InstanceFromRbxfile ¶
func InstanceFromRbxfile(inst *rbxfile.Instance, pool *SelfReferencePool, dictionary *InstanceDictionary) *Instance
func (*Instance) Copy ¶
func (instance *Instance) Copy(pool *SelfReferencePool) *Instance
func (*Instance) FindFirstChild ¶
func (*Instance) GetFullName ¶
func (*Instance) HasAncestor ¶
func (*Instance) ToRbxfile ¶
func (instance *Instance) ToRbxfile(pool *RbxfileReferencePool) *rbxfile.Instance
ToRbxfile converts an Instance to the rbxfile format Note: the parent of this instance must be assigned manually, however its children will have their respective parents set correctly
The conv argument is required so that the ValueReferences can be converted without creating duplicate references
func (*Instance) WaitForChild ¶
func (*Instance) WaitForProp ¶
type InstanceDictionary ¶
TODO: should work with PeerID
func NewInstanceDictionary ¶
func NewInstanceDictionary() *InstanceDictionary
func (*InstanceDictionary) NewReference ¶
func (dictionary *InstanceDictionary) NewReference() Reference
type InstanceList ¶
type InstanceList struct {
// contains filtered or unexported fields
}
func NewInstanceList ¶
func NewInstanceList() *InstanceList
func (*InstanceList) AddInstance ¶
func (l *InstanceList) AddInstance(ref Reference, instance *Instance)
func (*InstanceList) CreateInstance ¶
func (l *InstanceList) CreateInstance(ref Reference) (*Instance, error)
func (*InstanceList) Populate ¶
func (l *InstanceList) Populate(instances []*Instance)
func (*InstanceList) TryGetInstance ¶
func (l *InstanceList) TryGetInstance(ref Reference) (*Instance, error)
type RbxfileReferencePool ¶
type RbxfileReferencePool struct {
// contains filtered or unexported fields
}
RbxfileReferencePool holds a collection of visited instances This prevents the conversion from creating a duplicate rbxfile representation of an instance if it is visited twice (e.g.) normally and via ValueReference
func NewRbxfileReferencePool ¶
func NewRbxfileReferencePool() *RbxfileReferencePool
type SelfReferencePool ¶
type SelfReferencePool struct {
// contains filtered or unexported fields
}
SelfReferencePool holds a collection of visited instances This prevents the conversion from creating a duplicate rbxfile representation of an instance if it is visited twice (e.g.) normally and via ValueReference
func NewSelfReferencePool ¶
func NewSelfReferencePool() *SelfReferencePool
func (*SelfReferencePool) Make ¶
func (pool *SelfReferencePool) Make(instance *rbxfile.Instance) *Instance
func (*SelfReferencePool) MakeWithRef ¶
func (pool *SelfReferencePool) MakeWithRef(ref string) *Instance
type ValueArray ¶
func (ValueArray) Copy ¶
func (x ValueArray) Copy() rbxfile.Value
func (ValueArray) String ¶
func (x ValueArray) String() string
func (ValueArray) Type ¶
func (x ValueArray) Type() rbxfile.Type
type ValueColorSequence ¶
type ValueColorSequence []ValueColorSequenceKeypoint
func (ValueColorSequence) Copy ¶
func (x ValueColorSequence) Copy() rbxfile.Value
func (ValueColorSequence) String ¶
func (x ValueColorSequence) String() string
func (ValueColorSequence) Type ¶
func (x ValueColorSequence) Type() rbxfile.Type
type ValueColorSequenceKeypoint ¶
type ValueColorSequenceKeypoint rbxfile.ValueColorSequenceKeypoint
func (ValueColorSequenceKeypoint) Copy ¶
func (x ValueColorSequenceKeypoint) Copy() rbxfile.Value
func (ValueColorSequenceKeypoint) String ¶
func (x ValueColorSequenceKeypoint) String() string
func (ValueColorSequenceKeypoint) Type ¶
func (x ValueColorSequenceKeypoint) Type() rbxfile.Type
type ValueDeferredString ¶
type ValueDeferredString struct { Hash string Value rbxfile.ValueSharedString }
func (*ValueDeferredString) Copy ¶
func (x *ValueDeferredString) Copy() rbxfile.Value
func (*ValueDeferredString) String ¶
func (x *ValueDeferredString) String() string
func (*ValueDeferredString) Type ¶
func (x *ValueDeferredString) Type() rbxfile.Type
type ValueDictionary ¶
func (ValueDictionary) Copy ¶
func (x ValueDictionary) Copy() rbxfile.Value
func (ValueDictionary) String ¶
func (x ValueDictionary) String() string
func (ValueDictionary) Type ¶
func (x ValueDictionary) Type() rbxfile.Type
type ValueNumberSequence ¶
type ValueNumberSequence []ValueNumberSequenceKeypoint
func (ValueNumberSequence) Copy ¶
func (x ValueNumberSequence) Copy() rbxfile.Value
func (ValueNumberSequence) String ¶
func (x ValueNumberSequence) String() string
func (ValueNumberSequence) Type ¶
func (x ValueNumberSequence) Type() rbxfile.Type
type ValueNumberSequenceKeypoint ¶
type ValueNumberSequenceKeypoint rbxfile.ValueNumberSequenceKeypoint
func (ValueNumberSequenceKeypoint) Copy ¶
func (x ValueNumberSequenceKeypoint) Copy() rbxfile.Value
func (ValueNumberSequenceKeypoint) String ¶
func (x ValueNumberSequenceKeypoint) String() string
func (ValueNumberSequenceKeypoint) Type ¶
func (x ValueNumberSequenceKeypoint) Type() rbxfile.Type
type ValuePathWaypoint ¶
type ValuePathWaypoint struct { Position rbxfile.ValueVector3 Action uint32 }
func (ValuePathWaypoint) Copy ¶
func (x ValuePathWaypoint) Copy() rbxfile.Value
func (ValuePathWaypoint) String ¶
func (x ValuePathWaypoint) String() string
func (ValuePathWaypoint) Type ¶
func (x ValuePathWaypoint) Type() rbxfile.Type
type ValueReference ¶
func (ValueReference) Copy ¶
func (x ValueReference) Copy() rbxfile.Value
WARNING: Remember to set val.Instance yourself when copying
func (ValueReference) String ¶
func (x ValueReference) String() string
func (ValueReference) Type ¶
func (x ValueReference) Type() rbxfile.Type
type ValueRegion3 ¶
type ValueRegion3 struct { Start rbxfile.ValueVector3 End rbxfile.ValueVector3 }
func (ValueRegion3) Copy ¶
func (x ValueRegion3) Copy() rbxfile.Value
func (ValueRegion3) String ¶
func (x ValueRegion3) String() string
func (ValueRegion3) Type ¶
func (x ValueRegion3) Type() rbxfile.Type
type ValueRegion3int16 ¶
type ValueRegion3int16 struct { Start rbxfile.ValueVector3int16 End rbxfile.ValueVector3int16 }
func (ValueRegion3int16) Copy ¶
func (x ValueRegion3int16) Copy() rbxfile.Value
func (ValueRegion3int16) String ¶
func (x ValueRegion3int16) String() string
func (ValueRegion3int16) Type ¶
func (x ValueRegion3int16) Type() rbxfile.Type
type ValueSystemAddress ¶
func (ValueSystemAddress) Copy ¶
func (t ValueSystemAddress) Copy() rbxfile.Value
func (ValueSystemAddress) String ¶
func (t ValueSystemAddress) String() string
func (ValueSystemAddress) Type ¶
func (ValueSystemAddress) Type() rbxfile.Type
type ValueToken ¶
func (ValueToken) Copy ¶
func (x ValueToken) Copy() rbxfile.Value
func (ValueToken) String ¶
func (x ValueToken) String() string
func (ValueToken) Type ¶
func (x ValueToken) Type() rbxfile.Type
type ValueTuple ¶
func (ValueTuple) Copy ¶
func (x ValueTuple) Copy() rbxfile.Value
func (ValueTuple) String ¶
func (x ValueTuple) String() string
The following types should never be copied
func (ValueTuple) Type ¶
func (x ValueTuple) Type() rbxfile.Type
type ValueVector3int32 ¶
func (ValueVector3int32) Copy ¶
func (x ValueVector3int32) Copy() rbxfile.Value
func (ValueVector3int32) String ¶
func (x ValueVector3int32) String() string
func (ValueVector3int32) Type ¶
func (x ValueVector3int32) Type() rbxfile.Type