Files
encounter-system/Runtime/IEncounterEvent.cs
2026-04-19 12:25:49 +02:00

41 lines
1.6 KiB
C#

using System;
namespace Jovian.EncounterSystem {
/// <summary>
/// Marker interface for designer-authored dialog option side effects. Events carry data only;
/// behaviour is registered on <see cref="EncounterResolver"/> and dispatched by concrete type.
/// Add a new event by creating a new <see cref="IEncounterEvent"/> implementation and registering
/// a handler for it with the resolver.
/// </summary>
public interface IEncounterEvent {
}
/// <summary>Transitions the flow to another encounter identified by <see cref="nextEncounterId"/>.</summary>
[Serializable]
public class ChainToEncounterEvent : IEncounterEvent {
public string nextEncounterId;
}
/// <summary>Starts a combat encounter by id. Intended to be handled by the combat play mode.</summary>
[Serializable]
public class StartCombatEvent : IEncounterEvent {
public string combatEncounterId;
}
/// <summary>Writes a line to whatever log sink the resolver's handler is configured with. Useful for debugging.</summary>
[Serializable]
public class LogEvent : IEncounterEvent {
public string message;
}
/// <summary>
/// Grants the referenced <see cref="Reward"/> asset to the party. The actual application is
/// handled by a game-side delegate registered on <see cref="EncounterResolver"/>. Add multiple
/// <see cref="GiveRewardEvent"/>s to a dialog option's event list to grant multiple rewards.
/// </summary>
[Serializable]
public class GiveRewardEvent : IEncounterEvent {
public Reward reward;
}
}