mapGenerator

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: 15 Imported by: 0

README

Map Generator Service

The purpose of this Service Mesh service is to provide a way of generating "map" objects for diablo2, which are

Dependencies

This service depends upon the config file service and will initialize its own default config.

Integration with other services

This service exports an integration interface GeneratesDiablo2Maps 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 = GeneratesDiablo2Maps

type GeneratesDiablo2Maps interface {
    Seed() uint64
    SetSeed(uint64)
    GenerateMap(act, difficulty uint) (models.Diablo2Map, error)
}

Other services should use the GeneratesDiablo2Maps or Dependency interfaces to resolve their dependency on this service.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency = GeneratesDiablo2Maps

type GeneratesDiablo2Maps

type GeneratesDiablo2Maps interface {
	Seed() uint64
	SetSeed(uint64)
	GenerateMap(act, difficulty uint) (*WorldMap, error)
}

type Level

type Level struct {
	Name             string
	Data             models.LevelData
	Group            models.LevelGroup
	MazeData         models.LevelMazeData
	Preset           models.LevelPreset
	SubstitutionData models.LevelSubstitutionData
	Type             models.LevelType
	Warp             models.LevelWarp

	TileSets   []dt1.DT1
	TileStamps []ds1.DS1

	Act int
}

type Service

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

func (*Service) DependenciesResolved

func (s *Service) DependenciesResolved() bool

func (*Service) ExportToLua

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

func (*Service) GenerateMap

func (s *Service) GenerateMap(act, difficulty uint) (*WorldMap, error)

func (*Service) Init

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

func (*Service) InitRoutes

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

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) Seed

func (s *Service) Seed() uint64

func (*Service) SetLogger

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

func (*Service) SetSeed

func (s *Service) SetSeed(u uint64)

func (*Service) Slug

func (s *Service) Slug() string

func (*Service) UnexportFromLua

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

type WorldMap

type WorldMap struct {
	Levels map[act][]Level
}

func NewWorldMap

func NewWorldMap() *WorldMap

func (*WorldMap) LuaTable

func (wm *WorldMap) LuaTable(state *lua.LState) *lua.LTable

Jump to

Keyboard shortcuts

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