public static void CreateHuman(int magicAge)
        {
            Human human = new Human();
            human.Age = magicAge;

            if (magicAge % 2 == 0)
            {
                human.FullName = "The Boy";
                human.Gender = Gender.Male;
            }
            else
            {
                human.FullName = "The Girl";
                human.Gender = Gender.Female;
            }
        }
 public static void Main()
 {
     Human man = new Human();
     CreateHuman(10);
     Console.WriteLine("{0} {1}", man.FullName, man.Gender);
 }
示例#3
0
 public void Fireball(Human human) {
     Random rand = new Random();
     human.Health -= rand.Next(20, 50);
     
 }
 static void Main(string[] args)
 {
     Human h = new Human();
 }
示例#5
0
 public Human Attack(Human Target)
 {
     Target.health -= 5 * strength;
     System.Console.WriteLine(($"{Target.name} was attacked. Health is now at {Target.health}"));
     return(this);
 }