Class list

20241010: Ver.1 単純に思うがままに書き連ねる。改良前提。

Playable Characters

  • CoreManager
  • PhaseManager
  • InputManager
  • PartyModel

Characters

  • ICharacter(interface)
  • MemeberBase(abstruct:CharacterBase)
  • MonsterBase(abstruct:CharacterBase)
  • StatsModel

Items

  • IItemBase(interface)
  • EquipableItemBase(abstruct:IItemBase)
  • WeaponModel
  • ArmorModel

Commands

  • ICommandAction(interface)
  • CommandActionBase(abstruct:ICommandAction)
  • CommandManager

Battle

// Manager
public class BattleManager{
  private BattleFlowManager _battleFlowManager;

  void Start()
  {
      _battleFlowManager = new BattleFlowManager(this);
      _battleFlowManager.StartBattle();
  }

  void Update()
  {
      _battleFlowManager.Update();
  }}

// Battle Data
public class BattleContext{}

// Battle Flow
public class BattleFlowController{

  private BattleManager _battleManager;
  private IBattleState _currentState;

  public BattleFlowManager(BattleManager battleManager)
  {
      _battleManager = battleManager;
  }

  public void StartBattle()
  {
      ChangeState(new TargetSelectionState(OnTargetSelected));
  }

  public void Update()
  {
      _currentState?.UpdateState();
  }

  public void ChangeState(IBattleState newState)
  {
      _currentState?.EndState();
      _currentState = newState;
      _currentState.StartState(this); // BattleFlowManager を渡す
  }

  private void OnTargetSelected()
  {
      // ターゲットが選択された後の処理をここに実装
      Debug.Log("Target has been selected.");
  }}
//状態名の列挙体
public enum BattleState{}
// Logic for each state
public interface IBattleStateBase{
  void StartState(BattleFlowManager battleManager);
  void UpdateState();
  void EndState();}
public class BattleStatePartyPrepareHandler : IBattleStateBase{
  private BattleFlowManager _battleFlowManager;

  public void StartState(BattleFlowManager battleFlowManager)
  {
      _battleFlowManager = battleFlowManager;
      _battleFlowManager.StartCoroutine(PartyPrepareCoroutine());
  }

  private IEnumerator PartyPrepareCoroutine()
  {
      Debug.Log("Party Preparation Phase Started");
      // パーティの準備処理をここに書く
      yield return new WaitForSeconds(1f); // プレイヤーが準備する時間を模倣

      // 次の状態に遷移
      _battleFlowManager.ChangeState(new BattleStateOrderHandler());
  }

  public void UpdateState()
  {
      // 更新処理が必要な場合はここに書く
  }

  public void EndState()
  {
      Debug.Log("Party Preparation Phase Ended");
  }}
public class BattleStateEnemyPrepareHandler : IBattleStateBase{
    private BattleFlowManager _battleFlowManager;

    public void StartState(BattleFlowManager battleFlowManager)
    {
        _battleFlowManager = battleFlowManager;
        _battleFlowManager.StartCoroutine(EnemyPrepareCoroutine());
    }

    private IEnumerator EnemyPrepareCoroutine()
    {
        Debug.Log("Enemy Preparation Phase Started");
        // 敵の準備処理をここに書く
        yield return new WaitForSeconds(1.5f); // 敵の準備時間を模倣

        // 次の状態に遷移
        _battleFlowManager.ChangeState(new BattleStateOrderHandler());
    }

    public void UpdateState()
    {
        // 更新処理が必要な場合はここに書く
    }

    public void EndState()
    {
        Debug.Log("Enemy Preparation Phase Ended");
    }}
public class BattleStateFieldPrepareHandler : IBattleStateBase{
    private BattleFlowManager _battleFlowManager;

    public void StartState(BattleFlowManager battleFlowManager)
    {
        _battleFlowManager = battleFlowManager;
        _battleFlowManager.StartCoroutine(FieldPrepareCoroutine());
    }

    private IEnumerator FieldPrepareCoroutine()
    {
        Debug.Log("Field Preparation Phase Started");
        // フィールドの準備処理をここに書く
        yield return new WaitForSeconds(2f); // フィールド準備時間を模倣

        // 次の状態に遷移
        _battleFlowManager.ChangeState(new BattleStateOrderHandler());
    }

    public void UpdateState()
    {
        // 更新処理が必要な場合はここに書く
    }

    public void EndState()
    {
        Debug.Log("Field Preparation Phase Ended");
    }}
public class BattleStateOrderHandler : IBattleStateBase{
    private BattleFlowManager _battleFlowManager;

    public void StartState(BattleFlowManager battleFlowManager)
    {
        _battleFlowManager = battleFlowManager;
        _battleFlowManager.StartCoroutine(OrderCoroutine());
    }

    private IEnumerator OrderCoroutine()
    {
        Debug.Log("Order Phase Started");
        // コマンド入力待機処理をここに書く
        yield return new WaitForSeconds(1f); // コマンド選択時間を模倣

        // 次の状態に遷移
        _battleFlowManager.ChangeState(new BattleStateEscapeHandler());
    }

    public void UpdateState()
    {
        // 更新処理が必要な場合はここに書く
    }

    public void EndState()
    {
        Debug.Log("Order Phase Ended");
    }}
public class BattleStateEscapeHandler : IBattleStateBase{}
public class BattleStateSelectDesinationHandler : IBattleStateBase{}
public class BattleStateSelectStrategyHandler : IBattleStateBase{}
public class BattleStateSelectCommandHandler : IBattleStateBase{}
public class BattleStateSelectTargetHandler : IBattleStateBase{
  private Action _onTargetSelected;
  private BattleFlowManager _battleFlowManager;

  public TargetSelectionState(Action onTargetSelected)
  {
      _onTargetSelected = onTargetSelected;
  }

  public void StartState(BattleFlowManager battleFlowManager)
  {
      _battleFlowManager = battleFlowManager;
      Debug.Log("Target Selection Phase Started");
      _battleFlowManager.StartCoroutine(TargetSelectionCoroutine());
  }

  private IEnumerator TargetSelectionCoroutine()
  {
      // プレイヤーが攻撃対象を選択するまで待機
      yield return new WaitUntil(() => /* 攻撃対象選択が完了したらの条件 */);

      // 攻撃対象が選択されたら、登録されたアクションを実行
      _onTargetSelected?.Invoke();

      // 次の状態に遷移
      _battleFlowManager.ChangeState(new BattleActionState());
  }

  public void EndState()
  {
      Debug.Log("Target Selection Phase Ended");
  }

  public void UpdateState()
  {
      // この状態の更新処理(必要に応じて実装)
  }}

// Encount Logic
public class BattleEncounterController{}
public class BattleEncounteModel{}

// Generate Enemies
public class EnemyGenerator{}

// Battle Field MVVM
public class BattleMatrixHandler{}
public class BattleMatrixView{}
public class BattleMatrix{}

// Tile MVVM
public class BattleTileHandler{}
public class BattleTileView{}
public class BattleTile{}

// InputHandler
public class BattleInputHandler{}

// UI: バトルのFlowによって各Viewの表示、非表示、情報更新を行う}
public class BattleUIController{}
// Dialog
public interface IBattleUIDialogHandler{
    void DisplayDialog(string text);}
public class BattleUIDialogHandler : IBattleUIDialogHandler{
    public void DisplayDialog(string text)
    {
    }}
// Stats UI
public interface IBattleUIStatsHandler{
    void DisplayStats(string playerName, int health, int mana);}
public class BattleUIStatsHandler : IBattleUIStatsHandler{
    public void DisplayStats(string playerName, int health, int mana)
    {
        Console.WriteLine($"{playerName} - Health: {health}, Mana: {mana}");
    }}
//Main Command UI
public interface IBattleUIMainCommandHandler{
    void DisplayCommands(string[] commands);}
public class BattleUIMainCommandHandler : IBattleUIMainCommandHandler{
    public void DisplayCommands(string[] commands)
    {
        Console.WriteLine("Available Commands:");
        foreach (var command in commands)
        {
            Console.WriteLine($"- {command}");
        }
    }}
//Enemy Name UI
public interface IBattleUIEnemyNameHandler{
    void DisplayEnemyName(string enemyName);}
public class BattleUIEnemyNameHandler : IBattleUIEnemyNameHandler{
    public void DisplayEnemyName(string enemyName)
    {
        Console.WriteLine($"Enemy: {enemyName}");
    }}

//Graphic
public interface IBattleGraphicCharacterHandler{
    void StartAnimation(int charaID);}
public class BattleGraphicCHaracterHandler : IBattleGraphicCharacterHandler{
    public void StartAnimation(int charaID)
    {
    }}


// Action
public class BattleStateActionHandler : IBattleStateBase{
  private readonly Dictionary<string, IBattleCommand> _commands;

  public BattleActionHandler()
  {
      _commands = new Dictionary<string, IBattleCommand>
      {
          { "attack", new AttackCommand() },
          { "defend", new DefendCommand() },
          { "magic", new MagicCommand() },
          { "item", new ItemCommand() }
      };
  }

  // プレイヤーの選択に応じてコマンドを実行
  public void HandleCommand(string commandType, List<Character> targets)
  {
      if (_commands.ContainsKey(commandType.ToLower()))
      {
          IBattleCommand command = _commands[commandType.ToLower()];
          Console.WriteLine($"Executing {command.CommandName}...");
          command.Execute(targets);
      }
      else
      {
          Console.WriteLine($"Command '{commandType}' not recognized.");
      }
  }}
public interface IBattleCommand{
    void Execute(List<Character> targets);
    string CommandName { get; }}
public abstract class BattleCommandBase : IBattleCommand{
  public abstract string CommandName { get; }

  // 基本の実行メソッド
  public abstract void Execute();

  // 共通のロジックがある場合はここに記述
  protected void DisplayCommandMessage()
  {
      Console.WriteLine($"{CommandName} is being executed.");
  }}
public class BattleAttackCommand : BattleCommandBase{
  public override string CommandName => "Attack";

  public override void Execute(List<Character> targets)
  {
      DisplayCommandMessage();

      foreach (var target in targets)
      {
          // 攻撃ロジックをここに記述
          Console.WriteLine($"Attacking {target.Name}!");
      }
  }}
public class BattleDefendCommand : BattleCommandBase{
  public override string CommandName => "Defend";
  public override void Execute(List<Character> targets){
    DisplayCommandMessage();

    foreach (var target in targets)
    {
        // 防御ロジックをここに記述
        Console.WriteLine($"{target.Name} is defending.");
    }}}
public class BattleMagicCommand : BattleCommandBase{
  public override string CommandName => "Magic";

  public override void Execute(List<Character> targets)
  {
      DisplayCommandMessage();

      foreach (var target in targets)
      {
          // 魔法ロジックをここに記述
          Console.WriteLine($"Casting a spell on {target.Name}.");
      }
  }}
public class BattleItemCommand : BattleCommandBase{
  public override string CommandName => "Item";

  public override void Execute(List<Character> targets)
  {
      DisplayCommandMessage();

      foreach (var target in targets)
      {
          // 道具使用ロジックをここに記述
          Console.WriteLine($"Using an item on {target.Name}.");
      }}

All




# Core
public abstract class Core : MonoBehaviour{}


// Manager
public interface IManager{}
public class BattleManager : IManager{}


// Context
public interface IContext{}
public class BattleContext : IIContext{}





public interface IFlow{}
public class GameFlow : IFlow{}
public class TitleMenuFlow : IFlow{}
public class FieldFlow : IFlow{}
public class ShopFlow : IFlow{}
public class SequentialEventFlow : IFlow{}
public class BattleFlow : IFlow{}
public class WorldFieldFlow : IFlow{}






# Items
- IItemBase(interface)
- EquipableItemBase(abstruct:IItemBase)
- WeaponModel
- AccessoryModel
- BootsModel
- ConsumableItemModel

// ViewModel
public class ItemManager{}
public class ItemHandler{} // Use Item
public class InventoryHandler{} // Add, Remove
public class ItemUIHandler{} // Update Item Graphic

// Item Model 基本的に値変わらないのでreadのみ
public interface IItem{}
public abstract class EquipableItemBase{}
public class Weapon : EquipableItemBase{}
public class Armor : EquipableItemBase{}
public class Shoes : EquipableItemBase{}
public class Accesory : EquipableItemBase{}
public class Consumable : IItem{}




public interface IShop{}
public class GeneralShopModel : IShop{}
public class VendingMachineModel : IShop{}








// Battle
///////////////////////////
public interface IBattleState{}
// コマンド入力状態
public class CommandInputState : IBattleState{}

public class BattleFlowManager : GameFlowBase
{
    private IBattleState _currentState;

    public override void StartFlow()
    {
        ChangeState(new CommandInputState());
        Debug.Log("Battle Flow Started");
    }

    public override void UpdateFlow()
    {
        _currentState?.UpdateState();
    }

    public override void EndFlow()
    {
        _currentState?.EndState();
        Debug.Log("Battle Flow Ended");
    }

    public void ChangeState(IBattleState newState)
    {
        _currentState?.EndState();
        _currentState = newState;
        _currentState.StartState(this);
    }
}






















///////////////////////////
public class MainMenuFlowManager : GameFlowBase{}
public class ShopFlowManager : GameFlowBase{}
public class FieldFlowManager : GameFlowBase{

  public override void StartFlow()
  {
      _inputHandler = new FieldMovementInputHandler();
  }

  public override void UpdateFlow()
  {
      _inputHandler?.HandleInput();  // フィールド移動の入力処理
  }

  public override void EndFlow()
  {
      // フィールドフロー終了時の処理
  }

}
public class MapFieldFlowManager : GameFlowBase{}
public class AutoEventFlowManager : GameFlowBase{}
///////////////////////////


// Input System
///////////////////////////
//Update()で現在のflowを監視してInputSystemのモデルの更新
public class InputManager : MonoBehaviour{
  private InputSystem _imputSystem;
  private GameFlowManager _gameFlowManager;
  void Update(){

  }
}


// Battle,Fieldなどの状態。InputSystemのマップ切り替えに使用
public enum InputManager{
    FieldMovement,
    MenuNavigation,
    BattleInput
}

public enum InputMode{
    FieldMovement,
    MenuNavigation,
    BattleInput
}
//InputModeをプロパティに持つクラス
public class InputContext{
    public InputMode CurrentInputMode { get; set; }

    public InputContext()
    {
        CurrentInputMode = InputMode.Field; // 初期設定
    }

    public void ChangeInputMode(InputMode newMode)
    {
        CurrentInputMode = newMode;
    }
}
//InputContextをプロパティに持つモデル
public class InputModel{
    public InputContext Context { get; private set; }

    public void SetInputMode(InputMode mode)
    {
        Context.CurrentInputMode = mode;
    }

    public void ProcessInput()
    {
        switch (Context.CurrentInputMode)
        {
            case InputMode.FieldMovement:
                HandleFieldMovement();
                break;
            case InputMode.MenuNavigation:
                HandleMenuNavigation();
                break;
            case InputMode.BattleInput:
                HandleBattleInput();
                break;
        }
    }

    private void HandleFieldMovement()
    {
        // フィールド移動の処理
    }

    private void HandleMenuNavigation()
    {
        // メニューのナビゲーション処理
    }

    private void HandleBattleInput()
    {
        // バトル中の入力処理
    }
}
//InputModel.Context.CurrentInputModeに応じて必要なhandlerを返すクラス
public class InputHandlerFactory{
  public static IInputHandler GetInputHandler(InputMode mode)
  {
    switch (mode)
    {
        case InputMode.SingleColumnMenu:
            return new SingleColumnMenuInputHandler();
        case InputMode.DoubleColumnMenu:
            return new DoubleColumnMenuInputHandler();
        case InputMode.HorizontalSelectionMenu:
            return new HorizontalSelectionMenuInputHandler();
        // 他のモードを追加
        default:
            throw new ArgumentException("Unknown input mode");
    }
  }
}
//アクションマップの更新のみ行うクラス
public class ActionMapManager : MonoBehaviour
{
    // プレイヤーのInputActionAsset
    public InputActionAsset inputActions;

    private InputActionMap _currentActionMap;

    // 初期設定
    void Start()
    {
        // 初期状態として、例えば "Gameplay" アクションマップを有効にする
        EnableActionMap("Gameplay");
    }

    // 指定したアクションマップを有効化し、他のマップは無効化する
    public void EnableActionMap(string actionMapName)
    {
        // もし現在のアクションマップがあるなら、無効化する
        if (_currentActionMap != null)
        {
            _currentActionMap.Disable();
        }

        // 新しいアクションマップを探し、有効化する
        _currentActionMap = inputActions.FindActionMap(actionMapName);
        if (_currentActionMap != null)
        {
            _currentActionMap.Enable();
        }
        else
        {
            Debug.LogError($"Action Map {actionMapName} not found!");
        }
    }
}
///////////////////////////

- InputModel(Model) <= InputContextをプロパティに持つモデル

- InputContext




# InputModel.Context.Modeに応じて必要なhandlerを返すクラス
public class InputHandlerFactory
  {
      public static IInputHandler GetInputHandler(InputMode mode)
      {
          switch (mode)
          {
              case InputMode.SingleColumnMenu:
                  return new SingleColumnMenuInputHandler();
              case InputMode.DoubleColumnMenu:
                  return new DoubleColumnMenuInputHandler();
              case InputMode.HorizontalSelectionMenu:
                  return new HorizontalSelectionMenuInputHandler();
              // 他のモードを追加
              default:
                  throw new ArgumentException("Unknown input mode");
          }
      }
  }
- public interface IInputHandler <= 入力の処理定義のインターフェース
- public class FieldMovementInputHandler : IInputHandler <= フィールド移動の入力処理
- public class SingleColumnMenuInputHandler : IInputHandler <= 1列メニューの選択処理
- public class DoubleColumnMenuInputHandler : IInputHandler <= 2列メニューの選択処理
- public class HorizontalSelectionMenuInputHandler : IInputHandler <= 横方向メニューの選択処理








- PartyModel




# Characters
- ICharacter(interface)
- MemeberBase(abstruct:CharacterBase)
- MonsterBase(abstruct:CharacterBase)

- StatsModel


# Commands
- ICommandAction(interface)
- CommandActionBase(abstruct:ICommandAction)
- CommandManagerViewModel
- AttackCommandModel
- HealCommandModel

Module





public interface IBattleModule{}
public interface IFieldMotionModule{}
public interface IFieldModule{}
public interface IStoryModule{}
public interface IItemModule{}
public interface IShopModule{}
public interface IInputModule{}
public interface IMenuModule{}

---  Input ---
public class InputModule : IInputModule{}
// Manager
public class InputManager{}
// Input Department Roles
class AboutInputDepartment{}
// Input Mode Management Team
class GameFlowChecker{}
class GameFlowCommunicator{}伝達係  between GameFlowChecker & InputModeCoordinator
// Input Mode Switching
class InputModeCoordinator{}
class InpuModeCommunicator{}伝達係  between InputModeCoordinator & Delegate Hundler
class InputMapBook{}
class InputModeBook{}
class InputMapModeConnectionBook{}
// Input Reception Section
class InputReceptor{}
class InputCommunicator{}伝達係  between Receptor & Delegate Hundler
// Delegate Hundling
class InputDelegateRegister{}
class InputDelegateHundler{}


--- shop ---
public interface IShopModule{}
public class ShopModule{}
// Manager
public class ShopManager{}
// Flow
public class shopFlow : IFlow{}
public class shopSelectItemFlow : IFlow{}
public class shopSelectItemFlow : IFlow{}

// Shop UI Department
public class ShopUIManager{}
public class ShopDialogUI{}
public class ShopItemListUI{}
public class ShopAnswerBoxUI{}
public class ShopPartyBoxUI{}
public class ShopMemberBoxUI{}
// Shop Stats Data Departmant
public class ShopCustomer{}
// Shop Owner


-- Menu --
public class MenuModule{}
// Menu UI Department
public class MenuUIManager{}
public class MenuCommandListBoxUI : SingleColumnBox{}
public class MenuMoneyBoxUI{}
public class MenuInfoBoxUI{}
public class MenuPartyBoxUI{}
public class MenuMemberBoxUI{}
public class MenuMemberPictureBox{}
public class MenuMemberOverviewStatsBox{}
// Item Menu
public class MenuItemListBoxUI : SingleColumnBox{}
//Detailed Stats Menu
public class MenuMemberDetailedStatsBoxUI{}
public class MenuMemberEquipBoxUI{}
public class MenuMemberExpBoxUI{}
public class MenuMemberRecordBoxUI{} // 会心の一撃回数、気絶回数、敵を倒した数、コンボ成功回数、最大ダメージetc













-

000: public interface ICoreModule{}
100: public interface IStoryModule{}
900: public interface IInputModule{}

public interface IBattleModule{}
public interface IFieldMotionModule{}
public interface IFieldModule{}

public interface IItemModule{}
public interface IShopModule{}
public interface IMenuModule{}

— Flow Module —
public interfce IFlow{}
public class FlowLogic{
public void If()
public void While()
}

— Mediator 情報の仲介役—-
public interfce IMediator{
 public void receive()
 public void transfer()
}

— State Observer —-
public interfce IStateObserver{
 public void Check()
 public void NotifyManager(IManager manager)
}

— Manager —
public interface IManager{}

— Story —
public class StoryModule : IStoryModule{}
// Manager
public class StoryManager : IManager{}
// Story Flow
public class StoryFlowManager : IManager{}
public class StoryGenerator{} // generate book from seed data
public class StoryBook{}
public class StoryMainFlow : IFlow{} // Croutin
public class StoryQuestFlow : IFlow{}
public class StoryChapterFlow : IFlow{}
// Story State
public class StoryState{} // Where we are
public class StoryTracker : IStateObserver{}

— Input —
public class InputModule : IInputModule{}
// Manager
public class InputManager{}
// Input Department Roles
class AboutInputDepartment{}
// Input Mode Management Team
class GameStateChecker{}
class GameFlowMediator : IMediator{}伝達係 between GameFlowChecker & InputModeCoordinator
// Input Mode Switching
class InputModeCoordinator{}
class InpuModeMediator : IMediator{}伝達係 between InputModeCoordinator & Delegate Hundler
class InputMapBook{}
class InputModeBook{}
class InputMapModeConnectionBook{}
// Input Reception Section
class InputReceptor{}
class InputMediator : IMediator{}伝達係 between Receptor & Delegate Hundler
// Delegate Hundling
class InputDelegateRegister{}
class InputDelegateHundler{}

— shop —
public interface IShopModule{}
public class ShopModule{}
// Manager
public class ShopManager{}
// Flow
public class ShopFlowManager{}
public class ShopFlow : IFlow{}
public class ShopSelectItemFlow : IFlow{}
public class ShopSelectItemFlow : IFlow{}

// Shop UI Department
public class ShopUIManager{}
public class ShopDialogUI{}
public class ShopItemListUI{}
public class ShopAnswerBoxUI{}
public class ShopPartyBoxUI{}
public class ShopMemberBoxUI{}
// Shop Stats Data Departmant
public class ShopCustomer{}
// Shop Owner

— Menu —
public class MenuModule{}
// Manager
public class MenuManager{}
// Menu Flow
public class MenuFlow : IFlow{}
public class MenuFlowMediator : IMediator{}
public class MenuCommandFlow : IFlow{}
public class MenuItemFlow : IFlow{}
public class MenuTechFlow : IFlow{}
public class MenuEquipFlow : IFlow{}
public class MenuDetailedStatsFlow : IFlow{}

// Menu State management
public enum MenuState{}
public class MenuNavigator{}
public class MenuNavigationBook{}

// Menu UI Department
public class MenuUIManager{}
public class MenuCommandListBoxUI : SingleColumnBox{}
public class MenuMoneyBoxUI{}
public class MenuInfoBoxUI{}
public class MenuPartyBoxUI{}
public class MenuMemberBoxUI{}
public class MenuMemberPictureBox{}
public class MenuMemberOverviewStatsBox{}
// Item Menu
public class MenuItemListBoxUI : SingleColumnBox{}
// Tech Menu
public class MenuTechListBoxUI : SingleColumnBox{}
//Detailed Stats Menu
public class MenuMemberDetailedStatsBoxUI{}
public class MenuMemberEquipBoxUI{}
public class MenuMemberExpBoxUI{}
public class MenuMemberRecordBoxUI{} // MaxDamage, Kaishin Count, Combo Count

— Audio —
public class AudioModule{}
// Manager
public class AudioManager{}
class GameFlowChecker{}
// Music
public MusicCoordinator
public class MusicCollection{}
public SECoordinator
public class SECollection{}