static void Main(string[] args) { Ocean ocean = new Ocean(); ISwim swimPrey = new PreyLogic(); ISwim swimPred = new PredatorLogic(); ocean.initCells(swimPrey, swimPred); GuardOcean guardOc = new GuardOcean(ocean); for (int i = 0; i < Ocean.NUM_ITERATIONS; i++) { guardOc.Print(); ocean.run(); } }
public Predator(Coordinate coo, int timeToFeed = TIME_TO_FEED) : base(coo, Prey.TIME_TO_REPRODUCE) { Image = (char)ValueOcean.Shark; _timeToFeed = timeToFeed; _swim = new PredatorLogic(); }
public Prey(Coordinate coo, int timeToReproduce) : base(coo) { Image = (char)ValueOcean.Fish; _timeToReproduce = timeToReproduce; _swim = new PredatorLogic(); }