Exemplo n.º 1
0
        static void Main(string[] args)
        {
            PlayerClass pc = new PlayerClass()
            {
                Health = 100, Armour = 100
            };
            PlayerStruct ps = new PlayerStruct()
            {
                Health = 100, Armour = 100
            };

            KillPlayerClass(pc);
            KillPlayerStruct(ps);

            Console.WriteLine($"Class : {pc.Health}");
            Console.WriteLine($"Struct: {ps.Health}");
        }
Exemplo n.º 2
0
 static void KillPlayerStruct(PlayerStruct ps)
 {
     ps.Health = 0;
 }