hero

package
v0.0.0-...-126e10b Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 11 Imported by: 0

README

Hero Manager Service

The purpose of this Service Mesh service is to provide a means of managing heroes (player characters) for the game. This service uses the record manager to load up various records for character starting attributes items, graphois, etc.

Dependencies

This service has dependencies on the following services:

Integration with other services

This service integrates with the following services:

  • buzz

  • quzz

  • describe where the integration is optonal or not ...


This service exports an integration interface IsFoo with an alias Dependencncy which are intended to be used by other services for dependency resolution (see servicemesh.HasDependencies), and expose just the methods which other services should use.

type Dependency = Foo

type IsFoo interface {
    Foo()
}

Lua service integration

Describe how this service integrates with the lua service (this is just an example).

You should show an example of the lua API usage:

data = assets.load("/data/global/ui/Loading/loadingscreen.dc6")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency = ManagesHeroes

type ManagesHeroes

type ManagesHeroes interface {
	LoadHeroes() error
	SaveHeroes() error
	CreateHero(name string, hero models.Hero) State
	GetHeroes() []State
	GetHeroByName(name string) *State
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) ConfigFileName

func (s *Service) ConfigFileName() string

func (*Service) CreateHero

func (s *Service) CreateHero(name string, hero models.Hero) State

func (*Service) DefaultConfig

func (s *Service) DefaultConfig() (cfg configFile.Config)

func (*Service) DependenciesResolved

func (s *Service) DependenciesResolved() bool

func (*Service) ExportToLua

func (s *Service) ExportToLua(state *lua.LState)

func (*Service) GetHeroByName

func (s *Service) GetHeroByName(name string) *State

func (*Service) GetHeroes

func (s *Service) GetHeroes() []State

func (*Service) Init

func (s *Service) Init(mesh servicemesh.Mesh)

func (*Service) InitRoutes

func (s *Service) InitRoutes(group *gin.RouterGroup)

func (*Service) LoadConfig

func (s *Service) LoadConfig(config *configFile.Config)

func (*Service) LoadHeroes

func (s *Service) LoadHeroes() error

func (*Service) Logger

func (s *Service) Logger() *slog.Logger

func (*Service) Name

func (s *Service) Name() string

func (*Service) Ready

func (s *Service) Ready() bool

func (*Service) ResolveDependencies

func (s *Service) ResolveDependencies(services []servicemesh.Service)

func (*Service) SaveHeroes

func (s *Service) SaveHeroes() error

func (*Service) SetLogger

func (s *Service) SetLogger(logger *slog.Logger)

func (*Service) Slug

func (s *Service) Slug() string

func (*Service) UnexportFromLua

func (s *Service) UnexportFromLua(state *lua.LState)

type State

type State struct {
	Name       string
	Experience int
	Class      models.Hero `json:"Class,string"`
	Level      int

	Attributes map[string]int
	Skills     []string
	// contains filtered or unexported fields
}

func (*State) AddExperience

func (s *State) AddExperience(amount int)

func (*State) ExperienceRatio

func (s *State) ExperienceRatio() float32

func (*State) SetAttribute

func (s *State) SetAttribute(key string, value int)

func (*State) SetExperience

func (s *State) SetExperience(set int)

func (*State) SubtractExperience

func (s *State) SubtractExperience(amount int)

Jump to

Keyboard shortcuts

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