public knight Clone() { knight knight = new knight(); knight.hp = hp; knight.attack = attack; return(knight); }
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; }
static void KillKnight(knight knight) { knight.hp = 0; }
static void Main() { knight knight = new knight(50); }