Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 5, 2025 12:37
Show Gist options
  • Select an option

  • Save todorok1/fbb504ee8758f9d22df84c0581b7d670 to your computer and use it in GitHub Desktop.

Select an option

Save todorok1/fbb504ee8758f9d22df84c0581b7d670 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第62回 戦闘に関する機能を管理するクラス
/// <summary>
/// 敵キャラクターのステータスをセットします。
/// </summary>
/// <param name="enemyId">敵キャラクターのID</param>
public void SetUpEnemyStatus(int enemyId)
{
EnemyId = enemyId;
_enemyStatusManager.SetUpEnemyStatus(enemyId);
}
/// <summary>
/// 戦闘完了時のコールバックを登録します。
/// </summary>
public void RegisterCallback(IPostBattle postBattle)
{
_postBattle = postBattle;
}
/// <summary>
/// 戦闘の開始処理を行います。
/// </summary>
public void StartBattle()
{
SimpleLogger.Instance.Log("戦闘を開始します。");
GameStateManager.ChangeToBattle();
SetBattlePhase(BattlePhase.ShowEnemy);
TurnCount = 1;
IsBattleFinished = false;
_battleWindowManager.SetUpWindowControllers(this);
var messageWindowController = _battleWindowManager.GetMessageWindowController();
messageWindowController.HidePager();
_battleActionProcessor.InitializeProcessor(this);
_battleActionRegister.InitializeRegister(_battleActionProcessor);
_enemyCommandSelector.SetReferences(this, _battleActionRegister);
_battleResultManager.SetReferences(this);
_battleStarter.StartBattle(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment