From 539fd4820f37aa54df8878091db9680d89ee027a Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 13 Sep 2025 11:06:46 -0300 Subject: pergaminho --- scripts/Magic/SpellBook.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/Magic/SpellBook.cs (limited to 'scripts/Magic/SpellBook.cs') 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 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 -- cgit v1.2.3