blob: 8ccba71ac5289cc84a2e13399fd1fa87be4a526e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}
}
|