models

package
v0.0.0-...-9755efb Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

This section is empty.

Types

type Campaign

type Campaign struct {
	gorm.Model
	Private       bool
	Active        bool   `gorm:"-"`
	UserIsLead    bool   `gorm:"-"`
	Title         string `form:"title"`
	GameFile      string
	Description   string `form:"description"`
	Password      string `form:"password"`
	PasswordCheck string `gorm:"-" form:"passwordCheck"`
	LeadID        uint
	Lead          User        `gorm:"foreignKey:LeadID"`
	Users         []User      `gorm:"many2many:campaign_users;"`
	Characters    []Character `gorm:"many2many:campaign_characters;"`
}

type CampaignCharacter

type CampaignCharacter struct {
	Id          string
	Name        string
	Description string
	Image       CampaignImage
	Health      CampaignCharacterHealth
	Inventories []CampaignInventory
	Controllers []string
}

func GetNewCampaignCharacter

func GetNewCampaignCharacter() CampaignCharacter

type CampaignCharacterHealth

type CampaignCharacterHealth struct {
	Id                 string `json:"id"`
	Damage             string `json:"damage"`
	TemporaryHitPoints string `json:"temp"`
	MaximumHitPoints   string `json:"max"`
}

type CampaignContentItem

type CampaignContentItem struct {
	Id      string
	Html    string
	Objects string
}

type CampaignImage

type CampaignImage struct {
	Name   string `json:"Name"`
	Url    string `json:"Url"`
	Id     string
	Active bool
}

type CampaignInventory

type CampaignInventory struct {
	Id    string
	Items []CampaignInventoryItem
}

type CampaignInventoryItem

type CampaignInventoryItem struct {
	Id          string
	Count       uint
	Name        string
	Description string
	Damage      string
	Restore     string
	Range       CampaignInventoryItemRange
}

type CampaignInventoryItemRange

type CampaignInventoryItemRange struct {
	Min string
	Max string
}

type CampaignMap

type CampaignMap struct {
	Id          string
	Name        string
	Description string
	X           uint
	Y           uint
	Active      bool
	ActiveImage CampaignImage
	Images      []CampaignImage
}

type CampaignMapCellContent

type CampaignMapCellContent struct {
	Id      string
	Visible bool
	Health  uint
	Image   CampaignImage
}

type CampaignScreenContent

type CampaignScreenContent struct {
	Tabs    []CampaignTabItem
	Content []CampaignContentItem
}

func NewCampaignScreenContent

func NewCampaignScreenContent() CampaignScreenContent

type CampaignScreenMapItemElement

type CampaignScreenMapItemElement struct {
	Id          string   `json:"Id"`
	EntityName  string   `json:"EntityName"`
	EntityId    string   `json:"EntityId"`
	Hidden      bool     `json:"Hidden"`
	Controllers []string `json:"Controllers"`
	MapId       string   `json:"MapId"`
	Html        string   `json:"Html"`
	Position    CampaignScreenMapPosition
	Image       CampaignImage
	Health      CampaignScreenMapItemHealth
}

func (*CampaignScreenMapItemElement) HasHealth

func (mi *CampaignScreenMapItemElement) HasHealth() bool

type CampaignScreenMapItemHealth

type CampaignScreenMapItemHealth struct {
	Total   uint
	Current int
}

type CampaignScreenMapItems

type CampaignScreenMapItems struct {
	MapId    string
	Elements map[string]CampaignScreenMapItemElement
}

type CampaignScreenMapPosition

type CampaignScreenMapPosition struct {
	X string `json:"X"`
	Y string `json:"Y"`
}

type CampaignService

type CampaignService struct{}

func (*CampaignService) AddUserToCampaign

func (service *CampaignService) AddUserToCampaign(user User, campaign Campaign) error

func (*CampaignService) InsertCampaign

func (service *CampaignService) InsertCampaign(campaign *Campaign) error

func (*CampaignService) RetrieveCampaignsById

func (service *CampaignService) RetrieveCampaignsById(id uint) (Campaign, error)

func (*CampaignService) RetrieveCampaignsByIds

func (service *CampaignService) RetrieveCampaignsByIds(ids []uint) ([]Campaign, error)

func (*CampaignService) RetrieveCampaignsLinkedToUser

func (service *CampaignService) RetrieveCampaignsLinkedToUser(user User) ([]Campaign, error)

type CampaignTabItem

type CampaignTabItem struct {
	Id   string
	Html string
}

type Character

type Character struct {
	gorm.Model
	Name        string
	Description string        `gorm:"-"`
	Id          string        `gorm:"-"`
	Image       CampaignImage `gorm:"-"`
	Visible     bool          `gorm:"-"`
	Online      bool          `gorm:"-"`
}

type Characters

type Characters []Character

func (Characters) Len

func (c Characters) Len() int

func (Characters) Less

func (c Characters) Less(i, j int) bool

func (Characters) Swap

func (c Characters) Swap(i, j int)

type User

type User struct {
	gorm.Model
	Name          string `gorm:"unique" form:"username"`
	Password      string `form:"password"`
	PasswordCheck string `gorm:"-" form:"passwordCheck"`
	Type          UserType
}

type UserService

type UserService struct{}

func (UserService) InsertUser

func (service UserService) InsertUser(user *User) error

type UserType

type UserType string
const (
	ADMIN   UserType = "USER_ADMIN"
	REGULAR UserType = "USER_ADMIN"
)

Jump to

Keyboard shortcuts

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