Beispiel #1
0
            public knight Clone()
            {
                knight knight = new knight();

                knight.hp     = hp;
                knight.attack = attack;
                return(knight);
            }
Beispiel #2
0
            static void Main(string[] args)
            {
                Mage mage;

                mage.hp     = 100;
                mage.attack = 50;

                Mage mage2 = mage;

                mage2.hp = 0;

                knight knight = new knight();

                knight.hp     = 100;
                knight.attack = 10;

                knight knight2 = knight.Clone();

                knight2.hp = 0;
            }
Beispiel #3
0
 static void KillKnight(knight knight)
 {
     knight.hp = 0;
 }
Beispiel #4
0
 static void Main()
 {
     knight knight = new knight(50);
 }