示例#1
0
文件: Giant.cs 项目: t4h3d1f/critters
 // returns the move to be made by the giant
 public override Action getMove(CritterInfo info)
 {
     if (info.getFront() == Neighbor.OTHER)
     {
         return(Action.INFECT);
     }
     else if (info.getFront() != Neighbor.EMPTY)
     {
         return(Action.RIGHT);
     }
     else
     {
         return(Action.HOP);
     }
 }
示例#2
0
 // returns the move to be made by the bear
 public override Action getMove(CritterInfo info)
 {
     Console.WriteLine(info.getInfectCount() + "  Bear  ");
     if (info.getFront() == Neighbor.OTHER)
     {
         return(Action.INFECT);
     }
     else if (info.getFront() == Neighbor.EMPTY)
     {
         return(Action.HOP);
     }
     else
     {
         return(Action.LEFT);
     }
 }
示例#3
0
 public new Action getMove(CritterInfo info)
 {
     if (info.getFront() == Neighbor.OTHER)
     {
         return(Action.INFECT);
     }
     else
     {
         return(Action.LEFT);
     }
 }