I try to create a Dictionary to call some functions.
My array takes a key Int, a String and a function, like this:
let list_weapons: [Int: [Any]] = [1: ["Sword", attack_sword],
2: ["Magic wand", heal_magic_wand],
3: ["Hammer", attack_hammer],
4: ["Axe", attack_axe]]
These functions take a Class as a parameter, like this:
func attack_sword(character: Character)
I try to call my function like that but it doesn't work.
list_weapons[1]
Cannot call value of non-function type 'Any'
If you have some ideas or advise me with another container
Thank you