summaryrefslogtreecommitdiff
path: root/scripts/Magic/SpellBook.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-13 11:06:46 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-13 11:06:46 -0300
commit539fd4820f37aa54df8878091db9680d89ee027a (patch)
tree41f9f5d6aa123058e3549c1baba4155fa5a85279 /scripts/Magic/SpellBook.cs
parentb8962990ddb75b874a49c83d8eeaba7b7e45c196 (diff)
pergaminho
Diffstat (limited to 'scripts/Magic/SpellBook.cs')
-rw-r--r--scripts/Magic/SpellBook.cs20
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