public void TestConsumeNextNRngPositions() { SpawnRngHelper helper = GetDefaultHelper(); helper.FindFirstRngPosition(94); helper.FindNextRngPosition(89); Assert.IsTrue(helper.ConsumeNextNRngPositions(10)); helper.FindNextRngPosition(95); helper.CalculateRng(100); Assert.AreEqual(94, helper.GetNextExpectedHealValue()); }
public void TestLastNBeforeMCalculation() { SpawnRngHelper helper = GetComplexHelper(); helper.FindFirstRngPosition(89); helper.FindNextRngPosition(87); helper.FindNextRngPosition(97); helper.CalculateRng(100); Assert.AreEqual(1, helper.GetSpawnFutureRng() .GetStepsToLastNSpawnBeforeMSpawn(0, 1)); helper.ConsumeNextNRngPositions(10); helper.CalculateRng(100); Assert.AreEqual(4, helper.GetSpawnFutureRng() .GetStepsToLastNSpawnBeforeMSpawn(0, 1)); }
private void bConsume_Click(object sender, EventArgs e) { int consume; int.TryParse(tbConsume.Text, out consume); DateTime begint = DateTime.Now; _rngHelper.ConsumeNextNRngPositions(consume); DateTime endt = DateTime.Now; toolStripStatusLabelPercent.Text = (endt - begint).ToString(); int numRows = FormUtils.ParseNumRows(tbNumRows.Text); _rngHelper.CalculateRng(numRows); DisplayFutureRng(); }