using System;
using ActionGame;
using UnityEngine;
namespace KKAPI.MainGame
{
///
/// Base type for custom game extensions.
/// It provides many useful methods that abstract away the nasty hooks needed to figure out when the state of the game
/// changes.
///
/// This controller is a MonoBehaviour that is created upon registration in .
/// The controller is created only once. If it's created too late it might miss some events.
/// It's recommended to register controllers in your Start method.
///
public abstract class GameCustomFunctionController : MonoBehaviour
{
// todo in the future add extended save to game saves
private static Cycle _cycle;
///
/// Extended save ID used by this function controller
///
[Obsolete("Not yet implemented")]
public string ExtendedDataId { get; internal set; }
///
/// Triggered when the H scene is ended, but before it is unloaded.
/// Warning: This is triggered in free H as well!
///
/// H scene controller instance
/// If true, the h scene was started from Main menu > Extra > FreeH
protected internal virtual void OnEndH(HSceneProc proc, bool freeH) { }
///
/// Triggered when the night menu is entered at the end of the day (screen where you can save and load the game).
/// You can use to see what day it is as well as other game state.
///
protected internal virtual void OnEnterNightMenu() { }
///
/// Triggered right after game state was loaded from a file. Some things might still be uninitialized.
///
protected internal virtual void OnGameLoad(GameSaveLoadEventArgs args) { }
///
/// Triggered right before game state is saved to a file.
///
protected internal virtual void OnGameSave(GameSaveLoadEventArgs args) { }
///
/// Triggered after an H scene is loaded.
/// Warning: This is triggered in free H as well!
///
/// H scene controller instance
/// If true, the h scene was started from Main menu > Extra > FreeH
protected internal virtual void OnStartH(HSceneProc proc, bool freeH) { }
///
/// Get the current game Cycle object, if it exists.
///
protected static Cycle GetCycle()
{
if (_cycle == null)
_cycle = FindObjectOfType();
return _cycle;
}
///
/// Triggered when the current day changes in story mode.
///
protected internal virtual void OnDayChange(Cycle.Week day) { }
///
/// Triggered when the current time of the day changes in story mode.
///
protected internal virtual void OnPeriodChange(Cycle.Type period) { }
}
}