예제 #1
0
        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();
            }
        }
예제 #2
0
 public Predator(Coordinate coo, int timeToFeed = TIME_TO_FEED) : base(coo, Prey.TIME_TO_REPRODUCE)
 {
     Image       = (char)ValueOcean.Shark;
     _timeToFeed = timeToFeed;
     _swim       = new PredatorLogic();
 }
예제 #3
0
 public Prey(Coordinate coo, int timeToReproduce) : base(coo)
 {
     Image            = (char)ValueOcean.Fish;
     _timeToReproduce = timeToReproduce;
     _swim            = new PredatorLogic();
 }