public CSimpleSector[] GetSectorData() { CSimpleSector[] Secotrs = new CSimpleSector[GlobalConfiguration.Assignemnt.SectorCount]; var objSectorialBrigade = Enum.GetValues(typeof(ESectorialBrigade)); ESectorialBrigade[] BrigadeAss = new ESectorialBrigade[GlobalConfiguration.Assignemnt.SectorCount]; for (int i = 0; i < GlobalConfiguration.Assignemnt.SectorCount; i++) { BrigadeAss[i] = (ESectorialBrigade)objSectorialBrigade.GetValue(Shared.Next(objSectorialBrigade.Length)); } BrigadeAss = BrigadeAss.OrderBy(x => (int)x).ToArray(); DateTime FirstWednesday = new DateTime(2018, 1, 1); while (FirstWednesday.Date.DayOfWeek != DayOfWeek.Wednesday) { FirstWednesday = FirstWednesday.AddDays(1); } for (int i = 0; i < Secotrs.Length; i++) { Secotrs[i] = new CSimpleSector( "Sec1" + i, EConstraints.All, BrigadeAss[i], FirstWednesday); Secotrs[i].SetUID(i); } return(Secotrs); }
public CSimpleSector[] GetSectorData() { CSimpleSector[] Secotrs = new CSimpleSector[GlobalConfiguration.Assignemnt.SectorCount]; var objSectorialBrigade = Enum.GetValues(typeof(ESectorialBrigade)); ESectorialBrigade[] BrigadeAss = new ESectorialBrigade[GlobalConfiguration.Assignemnt.SectorCount]; for (int i = 9; i < GlobalConfiguration.Assignemnt.SectorCount; i++) { BrigadeAss[i] = (ESectorialBrigade)objSectorialBrigade.GetValue(Shared.Next(objSectorialBrigade.Length - 3) + 3); } BrigadeAss = BrigadeAss.OrderBy(x => (int)x).ToArray(); DateTime FirstWednesday = new DateTime(2018, 1, 1); while (FirstWednesday.Date.DayOfWeek != DayOfWeek.Wednesday) { FirstWednesday = FirstWednesday.AddDays(1); } var c = 0; Secotrs[c] = new CSimpleSector("Sec0", EConstraints.ArmoredBattalion, ESectorialBrigade.Brigade1, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec1", EConstraints.ArmoredBattalion, ESectorialBrigade.Brigade1, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec2", EConstraints.Land, ESectorialBrigade.Brigade1, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec3", EConstraints.Land, ESectorialBrigade.Brigade2, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec4", EConstraints.All, ESectorialBrigade.Brigade2, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec5", EConstraints.All, ESectorialBrigade.Brigade2, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec6", EConstraints.Land, ESectorialBrigade.Brigade3, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec7", EConstraints.All, ESectorialBrigade.Brigade3, FirstWednesday); Secotrs[c].SetUID(c++); Secotrs[c] = new CSimpleSector("Sec8", EConstraints.All, ESectorialBrigade.Brigade3, FirstWednesday); Secotrs[c].SetUID(c++); for (int i = c; i < Secotrs.Length; i++) { Secotrs[i] = new CSimpleSector("Sec" + i, EConstraints.All, BrigadeAss[i], FirstWednesday); Secotrs[i].SetUID(i); } return(Secotrs); }