Documentation ¶
Overview ¶
flame package provides structs for module and chapater.
Index ¶
- Constants
- type Chapter
- func (c *Chapter) AddAreas(areas ...*area.Area)
- func (c *Chapter) Apply(data res.ChapterData)
- func (c *Chapter) Area(areaID string) *area.Area
- func (c *Chapter) AreaObject(id, serial string) area.Object
- func (c *Chapter) AreaObjects() (objects []area.Object)
- func (c *Chapter) Areas() (areas []*area.Area)
- func (c *Chapter) Character(id, serial string) *character.Character
- func (c *Chapter) Characters() (chars []*character.Character)
- func (c *Chapter) Conf() *ChapterConfig
- func (c *Chapter) Data() res.ChapterData
- func (c *Chapter) ID() string
- func (c *Chapter) Module() *Module
- func (c *Chapter) ObjectArea(ob area.Object) *area.Area
- func (c *Chapter) Resources() *res.ResourcesData
- func (c *Chapter) Update(delta int64)
- type ChapterConfig
- func (cc ChapterConfig) AreasPath() string
- func (cc ChapterConfig) CharactersPath() string
- func (cc ChapterConfig) DialogsPath() string
- func (cc ChapterConfig) FullPath() string
- func (cc ChapterConfig) LangPath() string
- func (cc ChapterConfig) ObjectsPath() string
- func (cc ChapterConfig) QuestsPath() string
- type Module
- func (m *Module) AddChangeChapterEvent(event func(char *character.Character))
- func (m *Module) Apply(data res.ModuleData)
- func (m *Module) Chapter() *Chapter
- func (m *Module) Conf() *ModuleConfig
- func (m *Module) Data() res.ModuleData
- func (m *Module) Object(id, serial string) serial.Serialer
- func (m *Module) Resources() *res.ResourcesData
- func (m *Module) SetChapter(chapter *Chapter)
- func (m *Module) Update(delta int64)
- type ModuleConfig
- func (c ModuleConfig) ChaptersPath() string
- func (c ModuleConfig) CharactersPath() string
- func (c ModuleConfig) EffectsPath() string
- func (c ModuleConfig) ItemsPath() string
- func (c ModuleConfig) LangPath() string
- func (c ModuleConfig) ObjectsPath() string
- func (c ModuleConfig) RacesPath() string
- func (c ModuleConfig) RecipesPath() string
- func (c ModuleConfig) SkillsPath() string
Constants ¶
const (
Name, Version = "Flame", "0.1.0-dev"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter struct {
// contains filtered or unexported fields
}
Chapter struct represents module chapter.
func NewChapter ¶
func NewChapter(mod *Module, data res.ChapterData) *Chapter
NewChapter creates new module chapter.
func (*Chapter) Apply ¶
func (c *Chapter) Apply(data res.ChapterData)
Apply applies specified data on the chapter. Also, adds chapter resources to resources base in res package.
func (*Chapter) Area ¶
Area returns area with specified ID, or nil if area with such ID was not found. Loads area if area with specified ID was not requested before.
func (*Chapter) AreaObject ¶
AreaObject retruns area object with specified ID and serial or nil if no object was found.
func (*Chapter) AreaObjects ¶
Objects returns list with all area objects from all loaded areas.
func (*Chapter) Character ¶
Character returns existing game character with specified serial ID or nil if no character with specified ID exists.
func (*Chapter) Characters ¶
Characters returns list with all existing(loaded) characters in chapter.
func (*Chapter) Data ¶
func (c *Chapter) Data() res.ChapterData
Data creates data resource for chapter.
func (*Chapter) ObjectArea ¶
ObjectArea returns area where specified area object is present, or nil if no such area was found.
func (*Chapter) Resources ¶
func (c *Chapter) Resources() *res.ResourcesData
Resources chapter resources.
type ChapterConfig ¶
type ChapterConfig struct { ID string Path string StartArea string StartPosX float64 StartPosY float64 StartItems []string StartSkills []string StartAttrs int StartLevel int }
Struct for chapter configurtion values.
func (ChapterConfig) AreasPath ¶
func (cc ChapterConfig) AreasPath() string
AreasPath returns path to chapters areas directory.
func (ChapterConfig) CharactersPath ¶
func (cc ChapterConfig) CharactersPath() string
CharactersPath returns path to chapter characters directory.
func (ChapterConfig) DialogsPath ¶
func (cc ChapterConfig) DialogsPath() string
DialogsPath returns path to chapter dialogs directory.
func (ChapterConfig) FullPath ¶
func (cc ChapterConfig) FullPath() string
FullPath returns path to chapter directory.
func (ChapterConfig) LangPath ¶
func (cc ChapterConfig) LangPath() string
LangPath returns path to chapter lang directory.
func (ChapterConfig) ObjectsPath ¶
func (cc ChapterConfig) ObjectsPath() string
ObjectsPath returns path to chapter objects directory.
func (ChapterConfig) QuestsPath ¶
func (cc ChapterConfig) QuestsPath() string
QuestsPath retruns path to chapter quests directory.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module struct represents game module.
func NewModule ¶
func NewModule(data res.ModuleData) *Module
NewModule creates new game module from specified data.
func (*Module) AddChangeChapterEvent ¶
AddChangeChapterEvent adds function to trigger when chapter change is required.
func (*Module) Apply ¶
func (m *Module) Apply(data res.ModuleData)
Apply applies specified data on the module. Also, adds module resources to resources base in res package.
func (*Module) Object ¶
Object returns game object with specified ID and serial or nil if no such object was found.
func (*Module) Resources ¶
func (m *Module) Resources() *res.ResourcesData
Resources returns module resources.
func (*Module) SetChapter ¶
SetChapter sets specified chapter as current chapter.
type ModuleConfig ¶
ModuleConfig struct represents module configuration.
func (ModuleConfig) ChaptersPath ¶
func (c ModuleConfig) ChaptersPath() string
ChaptersPath returns path to module chapters.
func (ModuleConfig) CharactersPath ¶
func (c ModuleConfig) CharactersPath() string
CharactersPath returns path to directory for exported characters.
func (ModuleConfig) EffectsPath ¶
func (c ModuleConfig) EffectsPath() string
EffectsPath returns path to directory with effects bases.
func (ModuleConfig) ItemsPath ¶
func (c ModuleConfig) ItemsPath() string
ItemsPath returns path to directory with items bases.
func (ModuleConfig) LangPath ¶
func (c ModuleConfig) LangPath() string
LangPath returns path to lang directory.
func (ModuleConfig) ObjectsPath ¶
func (c ModuleConfig) ObjectsPath() string
ObjectsPath returns path to directory with area objects bases.
func (ModuleConfig) RacesPath ¶
func (c ModuleConfig) RacesPath() string
RacesPath returns path to directory with races data files.
func (ModuleConfig) RecipesPath ¶
func (c ModuleConfig) RecipesPath() string
RecipesPath returns path to directory with recipes base.
func (ModuleConfig) SkillsPath ¶
func (c ModuleConfig) SkillsPath() string
SkillsPath returns path to directory with skills base.
Directories ¶
Path | Synopsis |
---|---|
Package with game area struct.
|
Package with game area struct. |
character package provides game character struct and other types for game characters.
|
character package provides game character struct and other types for game characters. |
Package for crafting structs.
|
Package for crafting structs. |
Package with functions for importing/exporting data files and directories.
|
Package with functions for importing/exporting data files and directories. |
res/lang
Package for easy retrieval of translation data.
|
Package for easy retrieval of translation data. |
Package for effects.
|
Package for effects. |
example
|
|
character/move
Example for moving module character.
|
Example for moving module character. |
game
Example of loading module and creating game.
|
Example of loading module and creating game. |
Package with engine log.
|
Package with engine log. |
Package with utils for module objects.
|
Package with utils for module objects. |
Package for requirements(e.g.
|
Package for requirements(e.g. |
Package for random number generator.
|
Package for random number generator. |
Package for generating unique serial values for game objects.
|
Package for generating unique serial values for game objects. |
Package for skill structs.
|
Package for skill structs. |
Package with training structs.
|
Package with training structs. |
Package with use action struct for usable objects.
|
Package with use action struct for usable objects. |