dto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACK

type ACK struct {
	ID [16]byte
}

func NewACK

func NewACK(ack infra.ACK) *ACK

NewACK convert a infra.ACK into a storage ACK.

func (ACK) Domain

func (ack ACK) Domain() infra.ACK

Domain converts a storage ACK into a game ACK.

func (*ACK) Marshal

func (d *ACK) Marshal(buf []byte) ([]byte, error)

func (*ACK) Size

func (d *ACK) Size() (s uint64)

func (*ACK) Unmarshal

func (d *ACK) Unmarshal(buf []byte) (uint64, error)

type Account

type Account struct {
	Username string
	Password string
}

Account represents the payload to create a new account via subscribe.

func (Account) Check

func (a Account) Check() error

Check check if username and passwords are valid.

func (Account) Domain

func (a Account) Domain() account.A

Domain transforms a dto account into a domain account.

type Cast

type Cast struct {
	AbilityID [16]byte
	Source    [16]byte
	Targets   [][16]byte
	Position  Vec3
}

func (*Cast) Marshal

func (d *Cast) Marshal(buf []byte) ([]byte, error)

func (*Cast) Size

func (d *Cast) Size() (s uint64)

func (*Cast) Unmarshal

func (d *Cast) Unmarshal(buf []byte) (uint64, error)

type ConnectPC

type ConnectPC struct {
	Token  ulid.ID
	Target ulid.ID
}

ConnectPC represents the payload to connect to an existing PC.

type DisconnectPC

type DisconnectPC struct {
	Token ulid.ID
}

DisconnectPC represents the payload to disconnect a token.

type Entity

type Entity struct {
	ID       [16]byte
	Type     [16]byte
	Name     string
	HP       uint64
	MP       uint64
	SectorID [16]byte
	X        float64
	Y        float64
	Z        float64
}

func NewEntity

func NewEntity(e entity.E) *Entity

NewEntity convert a entity.E into a storage Entity.

func (Entity) Domain

func (e Entity) Domain() entity.E

Domain converts a storage Entity into a game Entity.

func (*Entity) Marshal

func (d *Entity) Marshal(buf []byte) ([]byte, error)

func (*Entity) Size

func (d *Entity) Size() (s uint64)

func (*Entity) Unmarshal

func (d *Entity) Unmarshal(buf []byte) (uint64, error)

type EntityPC

type EntityPC struct {
	ID ulid.ID
}

EntityPC represents the response when connecting to an existing PC.

type Event

type Event struct {
	ID     [16]byte
	Token  [16]byte
	TS     int64
	Action interface{}
}

func (*Event) Marshal

func (d *Event) Marshal(buf []byte) ([]byte, error)

func (*Event) Size

func (d *Event) Size() (s uint64)

func (*Event) Unmarshal

func (d *Event) Unmarshal(buf []byte) (uint64, error)

type ListPC

type ListPC struct {
	Token ulid.ID
}

ListPC represents the payload to list token PCs.

type Move

type Move struct {
	Source   [16]byte
	Target   [16]byte
	Position Vec3
}

func (*Move) Marshal

func (d *Move) Marshal(buf []byte) ([]byte, error)

func (*Move) Size

func (d *Move) Size() (s uint64)

func (*Move) Unmarshal

func (d *Move) Unmarshal(buf []byte) (uint64, error)

type SetPC

type SetPC struct {
	Token ulid.ID
	Name  string
	Type  ulid.ID
}

SetPC represents the payload to send to create a new PC.

func (SetPC) Check

func (spc SetPC) Check() error

Check checks setpc validity.

type SignoutAccount

type SignoutAccount struct {
	Username string
	Token    ulid.ID
}

SignoutAccount represents the payload to create a new account via subscribe.

type Vec3

type Vec3 struct {
	X float64
	Y float64
	Z float64
}

func (*Vec3) Marshal

func (d *Vec3) Marshal(buf []byte) ([]byte, error)

func (*Vec3) Size

func (d *Vec3) Size() (s uint64)

func (*Vec3) Unmarshal

func (d *Vec3) Unmarshal(buf []byte) (uint64, error)

Jump to

Keyboard shortcuts

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