Example #1
0
 //
 // Check function to see if Morg should hunt potential prey.
 //
 public bool toHunt(Morg hunter, Morg prey)
 {
     if (hunter.getMorgtype() == 'A' && (prey.getMorgtype() == 'B' || prey.getMorgtype() == 'C') && prey.getLiving())
         return true;
     if (hunter.getMorgtype() == 'B' && prey.getMorgtype() == 'A' && prey.getLiving())
         return true;
     if (hunter.getMorgtype() == 'C' && (prey.getMorgtype() == 'A' || prey.getMorgtype() == 'B') &&  prey.getLiving())
         return true;
     else
         return false;
 }