You want to use static var CardList = ...
Longer explanation:
From what I can understand, you’re loading an array directly off a class, and not a class instance.
A class is, for example, Dog
, while a class instance would be var fido = Dog.new()
While class instances can have properties declared by var
, classes have properties declared either with:
const
- or
static var
The static
here denotes the var
is a property of the entire class, and not of its instances.