public Researcher(ContentManager cm, Random rng) { research = Parsers.Parsers.ParseResearch(@"Content/research/research_tree.txt", cm); stage = new int[3]; stage[0] = 0; stage[1] = 0; stage[2] = 0; sb = new StatusBar[3]; stager = new Stager <ButtonFunction, int>(new List <WTuple <ButtonFunction, bool, int> >()); stager.Add(new WTuple <ButtonFunction, bool, int>(ButtonFunction.R1, false, 0)); stager.Add(new WTuple <ButtonFunction, bool, int>(ButtonFunction.R2, false, 0)); stager.Add(new WTuple <ButtonFunction, bool, int>(ButtonFunction.R3, false, 0)); int totalAiResearch = 30; airesearch = new List <Researchables>(); for (int x = 0; x < totalAiResearch; x++) { airesearch.Add(Extensions.Extensions.RandomFlag <Researchables>(rng, 11, 13)); } }
public void InstantiateTest() { var stager = new Stager <MockSettingsManager>(); // Make sure both instances exist and are not the same Assert.IsNotNull(stager.Stable); Assert.IsNotNull(stager.Dirty); Assert.IsFalse(ReferenceEquals(stager.Stable, stager.Dirty)); }
public async Task StageProject(Guid id, int progressMin, int progressMax, Action <ProgressbarStateModel> reportProgress) { var configuration = await _configurationService.GetAsync(); var project = configuration.Projects.FirstOrDefault(e => e.Id == id); if (project == null) { return; } reportProgress.Invoke(new ProgressbarStateModel((int)Math.Floor(Utilities.Remap(10, 0, 100, progressMin, progressMax)), "Start Staging")); await Stager.StageAsync(reportProgress.Invoke, 10, 90, project, configuration.Guids); }
public void RevertStagingSyncTest() { var stager = new Stager <MockSettingsManager>(); // Should be in sync Assert.AreEqual(stager.Dirty.Str, stager.Stable.Str); // Change value stager.Dirty.Str = "553322"; // Should not be in sync Assert.AreNotEqual(stager.Dirty.Str, stager.Stable.Str); // Save stager.Save(); // Should be in sync Assert.AreEqual(stager.Dirty.Str, stager.Stable.Str); }
public void InstantiateWithFactoryTest() { var stager = new Stager <MockSettingsManager>( new MockSettingsManager { Int = 1337 }, new MockSettingsManager { Int = 6969 }); // Make sure both instances exist and are not the same Assert.IsNotNull(stager.Stable); Assert.IsNotNull(stager.Dirty); Assert.IsFalse(ReferenceEquals(stager.Stable, stager.Dirty)); // Check if factory worked Assert.AreEqual(1337, stager.Stable.Int); Assert.AreEqual(6969, stager.Dirty.Int); }
static void Main(string[] args) { Console.WriteLine("Rabotnik"); Rabotnik r1 = new Rabotnik(); r1.Zarplata(); Console.WriteLine(r1.GetInfo()); Console.WriteLine(r1.Zvilnenya()); Console.WriteLine(r1.GetInfo()); Console.WriteLine(r1.ToString()); Rabotnik r2; r2 = r1; if (r1.Equals(r2)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } Rabotnik r3 = new Rabotnik("Alex", "Dadov", 34, 22); if (r1.Equals(r3)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } if (r1.GetHashCode() == r2.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } if (r1.GetHashCode() == r3.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } Console.WriteLine("Stager"); Stager s1 = new Stager(); s1.Zarplata(); Console.WriteLine(s1.Info()); Console.WriteLine(s1.Zvilnenya()); Console.WriteLine(s1.Info()); Console.WriteLine(s1.ToString()); Stager s3; s3 = s1; if (s1.Equals(s3)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } Stager s2 = new Stager("Vasya", "Petrov", 7000, 20, "Finance"); if (s1.Equals(s2)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } if (s1.GetHashCode() == s2.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } if (s1.GetHashCode() == s3.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } s2.Zarplata(); Console.WriteLine(s2.Info()); Console.WriteLine("Ingener"); Ingener i1 = new Ingener(); i1.Zarplata(); Console.WriteLine(i1.Info()); Console.WriteLine(i1.Zvilnenya()); Console.WriteLine(i1.Info()); Console.WriteLine(i1.ToString()); Ingener i3; i3 = i1; if (i1.Equals(i3)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } Ingener i2 = new Ingener("Viktor", "Oleynik", 400, 10, 2); if (i1.Equals(i2)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } if (i1.GetHashCode() == i3.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } if (i1.GetHashCode() == i2.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } Console.WriteLine(i2.Info()); i2.Zarplata(); Console.WriteLine(i2.Info()); Console.WriteLine("Manager"); Manager m1 = new Manager(); m1.Zarplata(); Console.WriteLine(m1.GetInfo()); Console.WriteLine(m1.Zvilnenya()); Console.WriteLine(m1.Info()); Console.WriteLine(m1.ToString()); Manager m3; m3 = m1; if (m1.Equals(m3)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } Manager m2 = new Manager("Dmitriy", "Ivanov", 300, 18, "Semi-rpo"); if (m1.Equals(m2)) { Console.WriteLine("Ravni"); } else { Console.WriteLine("Ne Ravni"); } if (m1.GetHashCode() == r3.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } if (m1.GetHashCode() == m2.GetHashCode()) { Console.WriteLine("Same hash codes"); } else { Console.WriteLine("Not Same hash codes"); } m2.Zarplata(); Console.WriteLine(m2.GetInfo()); Console.WriteLine(m2.Zvilnenya()); Console.WriteLine(m2.Info()); Console.ReadKey(); }
private void Cancel() { Stager.RevertStaged(); }
private void Save() { Stager.Save(); }