Can't pass objects as parameters in method?
Here's the code: public class Fighter { public string Name; public int Health, DamagePerAttack; public Fighter(string name, int health, int damagePerAttack) { this.Name = name; this.Health = health; this.DamagePerAttack = damagePerAttack; } class Fight { public Fight(Fighter fighter1, Fighter fighter2) { while (fighter1.Health != 0 || fighter2.Health != 0) { fighter1.Health -= fighter2.DamagePerAttack; fighter2.Health -= fighter1.DamagePerAttack; if (fighter1.Health == 0) { Console.WriteLine(fighter2 + " is the winner!"); } else if (fighter2.Health == 0) { Console.WriteLine(fighter1 + " is the winner"); } else { Console.WriteLine("It's a draw!"); } } } } Fighter fighter01 = new Fighter("Robert", 100, 20); Fighter fighter02 = new Fighter("James", 200, 10); Fight FinalFight = new Fight(fighter01, fighter02); } } Error: A field initializer cannot reference the non-static field, method, or property 'Program.Fighter.fighter01'