diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-13 11:06:46 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-13 11:06:46 -0300 |
| commit | 539fd4820f37aa54df8878091db9680d89ee027a (patch) | |
| tree | 41f9f5d6aa123058e3549c1baba4155fa5a85279 /scripts/Magic/SpellBook.cs | |
| parent | b8962990ddb75b874a49c83d8eeaba7b7e45c196 (diff) | |
pergaminho
Diffstat (limited to 'scripts/Magic/SpellBook.cs')
| -rw-r--r-- | scripts/Magic/SpellBook.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/Magic/SpellBook.cs b/scripts/Magic/SpellBook.cs new file mode 100644 index 0000000..8ccba71 --- /dev/null +++ b/scripts/Magic/SpellBook.cs @@ -0,0 +1,20 @@ +using Godot; + +namespace TheLegendOfGustav.Magic; + +public partial class SpellBook : Node +{ + public Godot.Collections.Array<SpellResource> KnownSpells { get; private set; } = []; + + public bool KnowsSpell(SpellResource spell) => KnownSpells.Contains(spell); + + public void LearnSpell(SpellResource spell) { + if (!KnownSpells.Contains(spell)) { + KnownSpells.Add(spell); + } + } + + public void ForgetSpell(SpellResource spell) { + KnownSpells.Remove(spell); + } +}
\ No newline at end of file |
