diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 16:18:17 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 16:18:17 -0300 |
| commit | 9953c9a5818baa392a48a4d18339c73f3b7a814e (patch) | |
| tree | 3484fbca78bfa217d84226cc774119fe054f6df9 /scripts/entities/actors/actions/Action.cs | |
| parent | 7dbe2bbe431f77deb3515e5cf0810cfa07215d59 (diff) | |
Prepare
Diffstat (limited to 'scripts/entities/actors/actions/Action.cs')
| -rw-r--r-- | scripts/entities/actors/actions/Action.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/entities/actors/actions/Action.cs b/scripts/entities/actors/actions/Action.cs new file mode 100644 index 0000000..f20e262 --- /dev/null +++ b/scripts/entities/actors/actions/Action.cs @@ -0,0 +1,42 @@ +using Godot; + + +/// <summary> +/// <c>Action</c> representa uma ação no jogo efetuada por um ator. +/// Ações são geradas pelo jogador e pela IA, elas regem os atores do jogo. +/// </summary> +public abstract partial class Action : RefCounted { + /// <summary> + /// O ator que realiza a ação. + /// </summary> + protected Actor actor; + + // O custo da ação. + protected int cost; + + public Action(Actor actor) { + this.actor = actor; + // Custo base, subclasses podem sobreescrever isto se quiserem. + cost = 10; + } + + /// <summary> + /// Método que executa a ação. Subclasses da ação devem implementar este método. + /// <example> + /// Exemplo: + /// <code> + /// Action action = new Action(actor); + /// /* . . . */ + /// action.Perform(); + /// </code> + /// </example> + /// </summary> + public abstract void Perform(); + + /// <summary> + /// É conveniente ter acesso ao mapa dentro de uma ação. + /// </summary> + protected MapData Map_Data { + get => actor.Map_Data; + } +} |
