예제 #1
0
 public override void Execute()
 {
     AddedEvents.Remove(new Point(X, Y));
     for (int i = -1; i <= 1; ++i)
     {
         for (int j = -1; j <= 1; ++j)
         {
             UpdateCellEvent.Add(field, X + i, Y + j, DEVS.GlobalTime);
         }
     }
 }
예제 #2
0
 public static bool Add(GameField f, int X, int Y, double time)
 {
     f.CheckBorders(ref X, ref Y);
     if (!AddedEvents.Contains(new Point(X, Y)))
     {
         var ev = new UpdateCellEvent(f, X, Y);
         ev.eTime = time;
         DEVS.ModelEvent.Enque(ev);
         AddedEvents.Add(new Point(X, Y));
         return(true);
     }
     return(false);
 }
예제 #3
0
 public override void Execute()
 {
     for (int x = 0; x < field.Height; ++x)
     {
         for (int y = 0; y < field.Width; ++y)
         {
             if (field.isChanged(x, y))
             {
                 for (int i = -1; i <= 1; ++i)
                 {
                     for (int j = -1; j <= 1; ++j)
                     {
                         UpdateCellEvent EV = new UpdateCellEvent(field, x + i, y + j);
                         EV.eTime = eTime + 1;
                         DEVS.ModelEvent.Enque(EV);
                     }
                 }
             }
         }
     }
     field.Swap();
 }