void Scouting(object scout) { Scout scout1 = (Scout)scout; int count = 0; while (scout1.Move()) { if (Field.IsTarget(scout1.Location)) { scout1.FoundTargets += 1; } DrawScouts(); count++; Thread.Sleep(ThreadSpead); PrintFoundTargets(); } }
void SetScouts() { int count = 0; while (count < ThreadsAmount) { int x = rand.Next(Field.Height - 2) + 1; int y = rand.Next(Field.Width - 2) + 1; Point point = new Point(x, y); if (IsBusyPoint(point)) { continue; } busyPoints[count] = point; scouts[count] = new Scout(point, Colors[count]); scouts[count].CalculateFinishPoit(Field.Width, Field.Height); count++; } DrawScouts(); }