Documentation ¶
Overview ¶
Index ¶
- func NewLevel(world w.World, width gc.Row, height gc.Col) resources.Level
- type BuilderChain
- type BuilderMap
- func (bm BuilderMap) AdjacentOrthoAnyFloor(idx resources.TileIdx) bool
- func (bm BuilderMap) DownTile(idx resources.TileIdx) Tile
- func (bm BuilderMap) IsSpawnableTile(world w.World, tx gc.Row, ty gc.Col) bool
- func (bm BuilderMap) LeftTile(idx resources.TileIdx) Tile
- func (bm BuilderMap) RightTile(idx resources.TileIdx) Tile
- func (bm BuilderMap) UpTile(idx resources.TileIdx) Tile
- type InitialMapBuilder
- type LineCorridorBuilder
- type MetaMapBuilder
- type Rect
- type RectRoomBuilder
- type RoomDraw
- type Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuilderChain ¶
type BuilderChain struct { Starter *InitialMapBuilder Builders []MetaMapBuilder BuildData BuilderMap }
階層データBuilderMapに対して適用する生成ロジックを保持する構造体
func NewBuilderChain ¶
func NewBuilderChain(width components.Row, height components.Col) *BuilderChain
func SimpleRoomBuilder ¶
func SimpleRoomBuilder(width components.Row, height components.Col) *BuilderChain
func (*BuilderChain) Build ¶
func (b *BuilderChain) Build()
func (*BuilderChain) StartWith ¶
func (b *BuilderChain) StartWith(initialMapBuilder InitialMapBuilder)
func (*BuilderChain) With ¶
func (b *BuilderChain) With(metaMapBuilder MetaMapBuilder)
type BuilderMap ¶
type BuilderMap struct { // 階層情報 Level resources.Level // 階層を構成するタイル群。長さはステージの大きさで決まる Tiles []Tile // 部屋群。部屋は長方形の移動可能な空間のことをいう。 // 部屋はタイルの集合体である Rooms []Rect // 廊下群。廊下は部屋と部屋をつなぐ移動可能な空間のことをいう。 // 廊下はタイルの集合体である Corridors [][]resources.TileIdx }
階層のタイルを作る元になる概念の集合体
func (BuilderMap) AdjacentOrthoAnyFloor ¶ added in v1.43.0
func (bm BuilderMap) AdjacentOrthoAnyFloor(idx resources.TileIdx) bool
直交する近傍4タイルに床があるか判定する
func (BuilderMap) DownTile ¶ added in v1.43.0
func (bm BuilderMap) DownTile(idx resources.TileIdx) Tile
下にあるタイルを調べる
func (BuilderMap) IsSpawnableTile ¶ added in v1.47.0
指定タイル座標がスポーン可能かを返す スポーンチェックは地図生成時にしか使わないだろう
func (BuilderMap) LeftTile ¶ added in v1.43.0
func (bm BuilderMap) LeftTile(idx resources.TileIdx) Tile
右にあるタイルを調べる
type InitialMapBuilder ¶
type InitialMapBuilder interface {
BuildInitial(*BuilderMap)
}
type LineCorridorBuilder ¶
type LineCorridorBuilder struct{}
func (LineCorridorBuilder) BuildCorridors ¶
func (b LineCorridorBuilder) BuildCorridors(buildData *BuilderMap)
func (LineCorridorBuilder) BuildMeta ¶
func (b LineCorridorBuilder) BuildMeta(buildData *BuilderMap)
type MetaMapBuilder ¶
type MetaMapBuilder interface {
BuildMeta(*BuilderMap)
}
type RectRoomBuilder ¶
type RectRoomBuilder struct{}
長方形の部屋を作成する
func (RectRoomBuilder) BuildInitial ¶
func (b RectRoomBuilder) BuildInitial(buildData *BuilderMap)
func (RectRoomBuilder) BuildRooms ¶
func (b RectRoomBuilder) BuildRooms(buildData *BuilderMap)
Click to show internal directories.
Click to hide internal directories.