I have two different classes in the same C# source code file. At the top is a class named:
static class Persist : object
with the field:
public static List<Weapon> AllWeapons = new List<Weapon>() {
new Weapon("King's Spatha", 10, 20),
new Weapon("Nofoot Claw", 7, 11)
};
Further down the source file in a different class (not nested within the first class):
public static class King
And what I'm attempting to do within that class is the following:
public static Weapon UsedWeapon = Persist.AllWeapons[0];
The problem I have is not with finding out if King.UsedWeapon.ID = "King's Spatha"
. In fact, this code does work as intended.
The problem is that I don't fully understand what's happening under the hood. Does class Persist
exist before class King
? Does it matter which class is put above the other in the source code?