summaryrefslogtreecommitdiff
path: root/scripts/Magic/SpellBook.cs
diff options
context:
space:
mode:
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