fake

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 4 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	mock.Mock
}

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

func (e *Entity) ApplyUpdate(reader *bitread.BitReader)

ApplyUpdate is a mock-implementation of Entity.ApplyUpdate().

func (*Entity) BindPosition

func (e *Entity) BindPosition(pos *r3.Vector)

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) ID

func (e *Entity) ID() int

ID is a mock-implementation of Entity.ID().

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

func (e *Entity) OnPositionUpdate(handler func(pos r3.Vector))

OnPositionUpdate is a mock-implementation of Entity.OnPositionUpdate().

func (*Entity) Position

func (e *Entity) Position() r3.Vector

Position is a mock-implementation of Entity.Position().

func (*Entity) Properties

func (e *Entity) Properties() []st.Property

Properties is a mock-implementation of Entity.Properties().

func (*Entity) Property

func (e *Entity) Property(name string) st.Property

Property is a mock-implementation of Entity.Property().

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

type Property struct {
	mock.Mock
}

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) Name

func (p *Property) Name() string

Name is a mock-implementation of Property.Name().

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().

Jump to

Keyboard shortcuts

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