player

package
v0.0.0-...-37f97d0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthInventory        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInventory          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupInventory = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPlayer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPlayer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPlayer = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSpawn        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSpawn          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSpawn = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type App

type App interface {
	Store
	StoreSpawn
	StoreInventory
}

App applicative layer for P.

type Filter

type Filter struct {
	ID      gulid.ID
	Account gulid.ID
}

Filter object for P domain.

type FilterInventory

type FilterInventory struct {
	ID gulid.ID
}

FilterInventory object for P domain.

type FilterSpawn

type FilterSpawn struct {
	ID gulid.ID
}

FilterSpawn object for player spawn domain.

type Inventory

type Inventory struct {
	ID    github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"ID"`
	Size_ uint64                                `protobuf:"varint,2,opt,name=Size,proto3" json:"Size,omitempty"`
	Items map[string]uint64                     `` /* 142-byte string literal not displayed */
}

func NewPopulatedInventory

func NewPopulatedInventory(r randyInventory, easy bool) *Inventory

func (*Inventory) Descriptor

func (*Inventory) Descriptor() ([]byte, []int)

func (*Inventory) Equal

func (this *Inventory) Equal(that interface{}) bool

func (*Inventory) GetItems

func (m *Inventory) GetItems() map[string]uint64

func (*Inventory) GetSize_

func (m *Inventory) GetSize_() uint64

func (*Inventory) GoString

func (this *Inventory) GoString() string

func (*Inventory) Marshal

func (m *Inventory) Marshal() (dAtA []byte, err error)

func (*Inventory) MarshalTo

func (m *Inventory) MarshalTo(dAtA []byte) (int, error)

func (*Inventory) MarshalToSizedBuffer

func (m *Inventory) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Inventory) ProtoMessage

func (*Inventory) ProtoMessage()

func (*Inventory) Reset

func (m *Inventory) Reset()

func (*Inventory) Size

func (m *Inventory) Size() (n int)

func (*Inventory) String

func (this *Inventory) String() string

func (*Inventory) Unmarshal

func (m *Inventory) Unmarshal(dAtA []byte) error

func (*Inventory) XXX_DiscardUnknown

func (m *Inventory) XXX_DiscardUnknown()

func (*Inventory) XXX_Marshal

func (m *Inventory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Inventory) XXX_Merge

func (m *Inventory) XXX_Merge(src proto.Message)

func (*Inventory) XXX_Size

func (m *Inventory) XXX_Size() int

func (*Inventory) XXX_Unmarshal

func (m *Inventory) XXX_Unmarshal(b []byte) error

type P

type P struct {
	Entity  entity.E                              `protobuf:"bytes,1,opt,name=Entity,proto3" json:"Entity"`
	Account github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,2,opt,name=Account,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"Account"`
}

func NewPopulatedP

func NewPopulatedP(r randyPlayer, easy bool) *P

func (*P) Descriptor

func (*P) Descriptor() ([]byte, []int)

func (*P) Equal

func (this *P) Equal(that interface{}) bool

func (*P) GetEntity

func (m *P) GetEntity() entity.E

func (*P) GoString

func (this *P) GoString() string

func (*P) Marshal

func (m *P) Marshal() (dAtA []byte, err error)

func (*P) MarshalTo

func (m *P) MarshalTo(dAtA []byte) (int, error)

func (*P) MarshalToSizedBuffer

func (m *P) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*P) ProtoMessage

func (*P) ProtoMessage()

func (*P) Reset

func (m *P) Reset()

func (*P) Size

func (m *P) Size() (n int)

func (*P) String

func (this *P) String() string

func (*P) Unmarshal

func (m *P) Unmarshal(dAtA []byte) error

func (*P) XXX_DiscardUnknown

func (m *P) XXX_DiscardUnknown()

func (*P) XXX_Marshal

func (m *P) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*P) XXX_Merge

func (m *P) XXX_Merge(src proto.Message)

func (*P) XXX_Size

func (m *P) XXX_Size() int

func (*P) XXX_Unmarshal

func (m *P) XXX_Unmarshal(b []byte) error

type Spawn

type Spawn struct {
	ID        github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"ID"`
	Position  geometry.Vec3                         `protobuf:"bytes,2,opt,name=Position,proto3" json:"Position"`
	Direction geometry.Vec3                         `protobuf:"bytes,3,opt,name=Direction,proto3" json:"Direction"`
	Duration  uint64                                `protobuf:"varint,4,opt,name=Duration,proto3" json:"Duration,omitempty"`
}

func NewPopulatedSpawn

func NewPopulatedSpawn(r randySpawn, easy bool) *Spawn

func (*Spawn) Descriptor

func (*Spawn) Descriptor() ([]byte, []int)

func (*Spawn) Equal

func (this *Spawn) Equal(that interface{}) bool

func (*Spawn) GetDirection

func (m *Spawn) GetDirection() geometry.Vec3

func (*Spawn) GetDuration

func (m *Spawn) GetDuration() uint64

func (*Spawn) GetPosition

func (m *Spawn) GetPosition() geometry.Vec3

func (*Spawn) GoString

func (this *Spawn) GoString() string

func (*Spawn) Marshal

func (m *Spawn) Marshal() (dAtA []byte, err error)

func (*Spawn) MarshalTo

func (m *Spawn) MarshalTo(dAtA []byte) (int, error)

func (*Spawn) MarshalToSizedBuffer

func (m *Spawn) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Spawn) ProtoMessage

func (*Spawn) ProtoMessage()

func (*Spawn) Reset

func (m *Spawn) Reset()

func (*Spawn) Size

func (m *Spawn) Size() (n int)

func (*Spawn) String

func (this *Spawn) String() string

func (*Spawn) Unmarshal

func (m *Spawn) Unmarshal(dAtA []byte) error

func (*Spawn) XXX_DiscardUnknown

func (m *Spawn) XXX_DiscardUnknown()

func (*Spawn) XXX_Marshal

func (m *Spawn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Spawn) XXX_Merge

func (m *Spawn) XXX_Merge(src proto.Message)

func (*Spawn) XXX_Size

func (m *Spawn) XXX_Size() int

func (*Spawn) XXX_Unmarshal

func (m *Spawn) XXX_Unmarshal(b []byte) error

type Store

type Store interface {
	Upsert(context.Context, P) error
	Fetch(context.Context, Filter) (P, error)
	FetchMany(context.Context, Filter) (map[string]P, error)
	Delete(context.Context, Filter) error
}

Store storage layer for P.

type StoreInventory

type StoreInventory interface {
	UpsertInventory(context.Context, Inventory) error
	FetchInventory(context.Context, FilterInventory) (Inventory, error)
	DeleteInventory(context.Context, FilterInventory) error
}

StoreInventory storage layer for Inventory.

type StoreSpawn

type StoreSpawn interface {
	UpsertSpawn(context.Context, Spawn) error
	FetchSpawn(context.Context, FilterSpawn) (Spawn, error)
	DeleteSpawn(context.Context, FilterSpawn) error
}

StoreSpawn storage layer for player spawn.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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