Documentation ¶
Overview ¶
Package fake provides basic mocks for Entity and Property. See examples/mocking (https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/mocking).
Index ¶
- type Entity
- func (e *Entity) ApplyUpdate(reader *bitread.BitReader)
- func (e *Entity) BindPosition(pos *r3.Vector)
- func (e *Entity) BindProperty(name string, variable interface{}, valueType st.PropertyValueType)
- func (e *Entity) Destroy()
- func (e *Entity) ID() int
- func (e *Entity) OnCreateFinished(delegate func())
- func (e *Entity) OnDestroy(delegate func())
- func (e *Entity) OnPositionUpdate(handler func(pos r3.Vector))
- func (e *Entity) Position() r3.Vector
- func (e *Entity) Properties() []st.Property
- func (e *Entity) Property(name string) st.Property
- func (e *Entity) PropertyValue(name string) (st.PropertyValue, bool)
- func (e *Entity) PropertyValueMust(name string) st.PropertyValue
- func (e *Entity) ServerClass() *st.ServerClass
- type Property
- func (p *Property) ArrayElementType() st.PropertyType
- func (p *Property) Bind(variable interface{}, valueType st.PropertyValueType)
- func (p *Property) Name() string
- func (p *Property) OnUpdate(handler st.PropertyUpdateHandler)
- func (p *Property) Type() st.PropertyType
- func (p *Property) Value() st.PropertyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
Entity is a mock for of sendtables.Entity.
func NewEntityWithProperty ¶
func NewEntityWithProperty(name string, val st.PropertyValue) *Entity
NewEntityWithProperty creates and returns an entity with a single mocked property.
func (*Entity) ApplyUpdate ¶
ApplyUpdate is a mock-implementation of Entity.ApplyUpdate().
func (*Entity) BindPosition ¶
BindPosition is a mock-implementation of Entity.BindPosition().
func (*Entity) BindProperty ¶
func (e *Entity) BindProperty(name string, variable interface{}, valueType st.PropertyValueType)
BindProperty is a mock-implementation of Entity.BindProperty().
func (*Entity) Destroy ¶
func (e *Entity) Destroy()
Destroy is a mock-implementation of Entity.Destroy().
func (*Entity) OnCreateFinished ¶
func (e *Entity) OnCreateFinished(delegate func())
OnCreateFinished is a mock-implementation of Entity.OnCreateFinished().
func (*Entity) OnDestroy ¶
func (e *Entity) OnDestroy(delegate func())
OnDestroy is a mock-implementation of Entity.OnDestroy().
func (*Entity) OnPositionUpdate ¶
OnPositionUpdate is a mock-implementation of Entity.OnPositionUpdate().
func (*Entity) Properties ¶
Properties is a mock-implementation of Entity.Properties().
func (*Entity) PropertyValue ¶
func (e *Entity) PropertyValue(name string) (st.PropertyValue, bool)
PropertyValue is a mock-implementation of Entity.PropertyValue().
func (*Entity) PropertyValueMust ¶
func (e *Entity) PropertyValueMust(name string) st.PropertyValue
PropertyValueMust is a mock-implementation of Entity.PropertyValueMust().
func (*Entity) ServerClass ¶
func (e *Entity) ServerClass() *st.ServerClass
ServerClass is a mock-implementation of Entity.ServerClass().
type Property ¶
Property is a mock for of sendtables.Property.
func (*Property) ArrayElementType ¶ added in v2.13.3
func (p *Property) ArrayElementType() st.PropertyType
ArrayElementType is a mock-implementation of Property.ArrayElementType().
func (*Property) Bind ¶
func (p *Property) Bind(variable interface{}, valueType st.PropertyValueType)
Bind is a mock-implementation of Property.Bind().
func (*Property) OnUpdate ¶
func (p *Property) OnUpdate(handler st.PropertyUpdateHandler)
OnUpdate is a mock-implementation of Property.OnUpdate().
func (*Property) Type ¶ added in v2.8.0
func (p *Property) Type() st.PropertyType
Type is a mock-implementation of Property.Type().
func (*Property) Value ¶
func (p *Property) Value() st.PropertyValue
Value is a mock-implementation of Property.Value().