db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProfileAlreadyExists = errors.New("profile already exists")
)
View Source
var (
	ErrUserAlreadyExists = errors.New("user already exists")
)

Functions

This section is empty.

Types

type DB

type DB interface {
	Close()
	CreateProfile(profile *ProfileDB) error
	GetProfileById(userId uuid.UUID) (*ProfileDB, error)
	GetAllShipTypes() ([]*ShipType, error)
}

func NewConnection

func NewConnection() (DB, error)

type Door

type Door struct {
	RoomBlockOneId int
	RoomBlockTwoId int
}

type ProfileDB

type ProfileDB struct {
	UserId uuid.UUID `db:"user_id"`
	Name   string    `db:"name"`
}

type RoomBlock

type RoomBlock struct {
	Id   int
	PosX int
	PosY int
}

type RoomPlace

type RoomPlace struct {
	Id            int
	RoomBlockList []*RoomBlock
}

type ShipType

type ShipType struct {
	Id              uuid.UUID      `db:"id"`
	Name            string         `db:"name"`
	RoomPlaceList   []*RoomPlace   `db:"rome_place_list"`
	DoorList        []*Door        `db:"door_list"`
	WeaponPlaceList []*WeaponPlace `db:"weapon_place_list"`
}

type WeaponPlace

type WeaponPlace struct {
	PosX int
	PosY int
}

Jump to

Keyboard shortcuts

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