loader

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxGridSize = 50

最大のグリッドサイズ

Variables

This section is empty.

Functions

func LoadGameComponent

func LoadGameComponent(entityMetadataContent []byte, world w.World) []interface{}

func LoadLevel

func LoadLevel(packageData PackageData, selectLevel, levelNum, layoutWidth, layoutHeight int, gameSpriteSheet *ec.SpriteSheet) (vutil.Vec2d[Tile], loader.EntityComponentList, error)

階層データからエンティティ(コンポーネント群)を生成する selectLevel: 選択したフロアデータのインデックス levelNum: 今いる階数

func PreloadEntities

func PreloadEntities(entityMetadataPath string, world w.World) loader.EntityComponentList

func PreloadGameEntities

func PreloadGameEntities(entityMetadataPath string, world w.World) loader.EntityComponentList

Types

type Entity

type Entity struct {
	Components GameComponentList
}

type GameComponentList

type GameComponentList struct {
	GridElement      *gc.GridElement
	Player           *gc.Player
	Wall             *gc.Wall
	Warp             *gc.Warp
	Item             *gc.Item
	Name             *gc.Name
	Description      *gc.Description
	InBackpack       *gc.InBackpack
	Equipped         *gc.Equipped
	Consumable       *gc.Consumable
	InParty          *gc.InParty
	Member           *gc.Member
	Pools            *gc.Pools
	ProvidesHealing  *gc.ProvidesHealing
	InflictsDamage   *gc.InflictsDamage
	Attack           *gc.Attack
	Material         *gc.Material
	Recipe           *gc.Recipe
	Wearable         *gc.Wearable
	Attributes       *gc.Attributes
	EquipmentChanged *gc.EquipmentChanged
	Card             *gc.Card

	Position     *gc.Position
	SpriteRender *ec.SpriteRender
	BlockView    *gc.BlockView
	BlockPass    *gc.BlockPass
}

type PackageData

type PackageData struct {
	Name   string
	Levels []vutil.Vec2d[byte]
}

1つのパッケージは複数の階層を持つ

func LoadPackage

func LoadPackage(packageName string) (packageData PackageData, packageErr error)

設定ファイルをタイルとして読み出す。コンポーネント生成はしない あとで階を生成するときに、タイルを元にコンポーネントを生成する

type Tile

type Tile uint8

フィールドのタイル

const (
	TilePlayer Tile = 1 << iota
	TileWall
	TileWarpNext
	TileWarpEscape
	TileEmpty Tile = 0
)

func (*Tile) Contains

func (t *Tile) Contains(other Tile) bool

レシーバのゲームタイルが、引数のタイルを含んでいるかチェックする 同じならばTrue、引数のタイルが空白ならばTrue

func (*Tile) ContainsAny

func (t *Tile) ContainsAny(other Tile) bool

func (*Tile) Remove

func (t *Tile) Remove(other Tile)

タイルを削除

func (*Tile) Set

func (t *Tile) Set(other Tile)

タイルをセットする。TileEmptyは上書きされる

Jump to

Keyboard shortcuts

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