Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 26, 2025 11:17
Show Gist options
  • Select an option

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

Select an option

Save todorok1/83a2a164fbd5bb7c497aa4b4a56e5a5f to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第126回 メニューウィンドウにてアイテムに関する処理を制御するクラス
/// <summary>
/// 現在のページが有効な範囲か確認します。
/// </summary>
/// <param name="currentPage">現在のページ</param>
public int VerifyPage(int currentPage)
{
if (currentPage >= 0 && currentPage < GetMaxPageNum())
{
return currentPage;
}
else if (currentPage <= 0)
{
return 0;
}
else
{
return GetMaxPageNum() - 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment