共通の文字列定数
const ( // UI表示用の定数 TextNoDescription = "説明なし" // アイテムの説明がない場合の表示文字列 TextClose = "閉じる" // メニューやウィンドウを閉じる際の表示文字列 )
func ExecuteEnterAction(world w.World)
ExecuteEnterAction はEnterキーによる状況に応じたアクションを実行する
func ExecuteMoveAction(world w.World, direction gc.Direction)
ExecuteMoveAction は移動アクションを実行する
func ExecuteWaitAction(world w.World)
ExecuteWaitAction は待機アクションを実行する
func HandleWindowInput() (inputmapper.ActionID, bool)
HandleWindowInput はウィンドウモード時のキー入力をActionに変換する
func NewCraftMenuState() es.State[w.World]
NewCraftMenuState は新しいCraftMenuStateインスタンスを作成するファクトリー関数
func NewDebugMenuState() es.State[w.World]
NewDebugMenuState は新しいDebugMenuStateインスタンスを作成するファクトリー関数
func NewDungeonMenuState() es.State[w.World]
NewDungeonMenuState は新しいDungeonMenuStateインスタンスを作成するファクトリー関数
func NewDungeonState(depth int, opts ...DungeonStateOption) es.StateFactory[w.World]
NewDungeonState はDungeonStateインスタンスを作成するファクトリー関数 デフォルトではBuilderTypeはPlannerTypeRandomになる
func NewEquipMenuState() es.State[w.World]
NewEquipMenuState は新しいEquipMenuStateインスタンスを作成するファクトリー関数
func NewGameOverMessageState() es.State[w.World]
NewGameOverMessageState はゲームオーバー用のMessageStateを作成するファクトリー関数
func NewGameStartMessageState() es.State[w.World]
NewGameStartMessageState はゲーム開始時の目的を説明するMessageStateを作成するファクトリー関数
func NewInteractionMenuState(world w.World) es.State[w.World]
NewInteractionMenuState はインタラクションメニューStateを作成する
func NewInventoryMenuState() es.State[w.World]
NewInventoryMenuState は新しいInventoryMenuStateインスタンスを作成するファクトリー関数
func NewLoadMenuState() es.State[w.World]
NewLoadMenuState は新しいLoadMenuStateインスタンスを作成するファクトリー関数
func NewMainMenuState() es.State[w.World]
NewMainMenuState は新しいMainMenuStateインスタンスを作成するファクトリー関数
func NewMessageState(messageData *messagedata.MessageData) es.State[w.World]
NewMessageState はメッセージデータを受け取って新しいMessageStateを作成するファクトリー関数
func NewSaveMenuState() es.State[w.World]
NewSaveMenuState は新しいSaveMenuStateインスタンスを作成するファクトリー関数
func NewShopMenuState() es.State[w.World]
NewShopMenuState は新しいShopMenuStateインスタンスを作成するファクトリー関数
func UpdateFocusIndex(action inputmapper.ActionID, focusIndex *int, itemCount int) bool
UpdateFocusIndex はナビゲーションアクションに応じてフォーカスインデックスを更新する
CraftMenuState はクラフトメニューのゲームステート
type CraftMenuState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *CraftMenuState) DoAction(world w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *CraftMenuState) Draw(_ w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *CraftMenuState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *CraftMenuState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *CraftMenuState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *CraftMenuState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *CraftMenuState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st CraftMenuState) String() string
func (st *CraftMenuState) Update(world w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
DungeonState はダンジョン探索中のゲームステート
type DungeonState struct { es.BaseState[w.World] Depth int // Seed はマップ生成用のシード値(0の場合はDungeonリソースのシード値を使用) Seed uint64 // BuilderType は使用するマップビルダーのタイプ(BuilderTypeRandom の場合はランダム選択) BuilderType mapplanner.PlannerType }
func (st *DungeonState) DoAction(world w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *DungeonState) Draw(world w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *DungeonState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *DungeonState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *DungeonState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *DungeonState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *DungeonState) OnStop(world w.World) error
OnStop はステートが停止される際に呼ばれる
func (st DungeonState) String() string
func (st *DungeonState) Update(world w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
DungeonStateOption はDungeonStateのオプション設定関数
type DungeonStateOption func(*DungeonState)
func WithBuilderType(builderType mapplanner.PlannerType) DungeonStateOption
WithBuilderType はマップビルダータイプを設定するオプション
func WithSeed(seed uint64) DungeonStateOption
WithSeed はシード値を設定するオプション
EquipMenuState は装備メニューのゲームステート
type EquipMenuState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *EquipMenuState) DoAction(world w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *EquipMenuState) Draw(_ w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *EquipMenuState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *EquipMenuState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *EquipMenuState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *EquipMenuState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *EquipMenuState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st EquipMenuState) String() string
func (st *EquipMenuState) Update(world w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
InteractionAction はインタラクション可能なアクション情報
type InteractionAction struct { Label string // 表示ラベル(例:"開く(上)") Activity actions.ActivityInterface // 実行するアクティビティ Target ecs.Entity // ターゲットエンティティ }
func GetInteractionActions(world w.World) []InteractionAction
GetInteractionActions はプレイヤー周辺の実行可能なアクションを取得する
InventoryMenuState はインベントリメニューのゲームステート
type InventoryMenuState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *InventoryMenuState) DoAction(world w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *InventoryMenuState) Draw(_ w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *InventoryMenuState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *InventoryMenuState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *InventoryMenuState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *InventoryMenuState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *InventoryMenuState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st InventoryMenuState) String() string
func (st *InventoryMenuState) Update(world w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
MainMenuState は新しいメニューコンポーネントを使用するメインメニュー
type MainMenuState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *MainMenuState) DoAction(_ w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *MainMenuState) Draw(world w.World, screen *ebiten.Image) error
Draw はスクリーンに描画する
func (st *MainMenuState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *MainMenuState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *MainMenuState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *MainMenuState) OnStart(world w.World) error
OnStart はステート開始時の処理を行う
func (st *MainMenuState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st MainMenuState) String() string
func (st *MainMenuState) Update(_ w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
MessageState はメッセージを表示する専用ステート
type MessageState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *MessageState) Draw(_ w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *MessageState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *MessageState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *MessageState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *MessageState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st MessageState) String() string
func (st *MessageState) Update(_ w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
PersistentMessageState は選択肢実行後もウィンドウを開いたままにするMessageStateラッパー
type PersistentMessageState struct { MessageState }
func NewPersistentMessageState(messageData *messagedata.MessageData) *PersistentMessageState
NewPersistentMessageState は永続的なメッセージステートを作成する
func (st *PersistentMessageState) OnResume(world w.World) error
OnResume はステートが再開される際に呼ばれる
func (st PersistentMessageState) String() string
func (st *PersistentMessageState) Update(_ w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う
ShopMenuState はショップメニューのゲームステート
type ShopMenuState struct { es.BaseState[w.World] // contains filtered or unexported fields }
func (st *ShopMenuState) DoAction(world w.World, action inputmapper.ActionID) (es.Transition[w.World], error)
DoAction はActionを実行する
func (st *ShopMenuState) Draw(_ w.World, screen *ebiten.Image) error
Draw はゲームステートの描画処理を行う
func (st *ShopMenuState) HandleInput() (inputmapper.ActionID, bool)
HandleInput はキー入力をActionに変換する
func (st *ShopMenuState) OnPause(_ w.World) error
OnPause はステートが一時停止される際に呼ばれる
func (st *ShopMenuState) OnResume(_ w.World) error
OnResume はステートが再開される際に呼ばれる
func (st *ShopMenuState) OnStart(world w.World) error
OnStart はステートが開始される際に呼ばれる
func (st *ShopMenuState) OnStop(_ w.World) error
OnStop はステートが停止される際に呼ばれる
func (st ShopMenuState) String() string
func (st *ShopMenuState) Update(world w.World) (es.Transition[w.World], error)
Update はゲームステートの更新処理を行う