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

47 lines
1.8 KiB
C#

using System;
namespace Jovian.EncounterSystem {
/// <summary>
/// Marker interface for the polymorphic payload of a <see cref="Reward"/>.
/// Each concrete kind carries its own designer-facing data. Behaviour lives in a reward-applying
/// handler registered on <see cref="EncounterResolver"/> for <see cref="GiveRewardEvent"/> —
/// kinds are pure data. Add a new reward type by creating a new <see cref="IRewardKind"/>
/// implementation; the SubclassSelector drawer will surface it automatically.
/// </summary>
public interface IRewardKind {
}
/// <summary>Grants an amount of a named currency (gold, silver, faction-specific scrip, ...).</summary>
[Serializable]
public class CurrencyRewardKind : IRewardKind {
public string currencyId;
public int amount;
}
/// <summary>Grants one or more copies of an item identified by id.</summary>
[Serializable]
public class ItemRewardKind : IRewardKind {
public string itemId;
public int quantity;
}
/// <summary>Grants experience points to the party or a specific recipient.</summary>
[Serializable]
public class ExperienceRewardKind : IRewardKind {
public int amount;
}
/// <summary>Unlocks something identified by id (recipe, area, journal entry, achievement, ...).
/// What is actually unlocked is decided by the game-side handler.</summary>
[Serializable]
public class UnlockableRewardKind : IRewardKind {
public string unlockableId;
}
/// <summary>Catch-all with no kind-specific data — useful for prototyping or one-off rewards
/// whose semantics are carried by the <see cref="Reward.id"/> alone.</summary>
[Serializable]
public class OtherRewardKind : IRewardKind {
}
}