Пример #1
0
 public void CheckSteal_StealNone_EdgeCase()
 {
     Assert.AreEqual(
         "None",
         Steal.CheckSteal(3, 10, 55));
 }
Пример #2
0
 public void CheckModulo()
 {
     Assert.AreEqual(
         "Rare",
         Steal.CheckSteal(100, 0, 0));
 }
Пример #3
0
 public void CheckSteal_StealUncommon_EdgeCase()
 {
     Assert.AreEqual(
         "Uncommon",
         Steal.CheckSteal(3, 9, 0));
 }
Пример #4
0
 public void CheckSteal_StealCommon_EdgeCase()
 {
     Assert.AreEqual(
         "Common",
         Steal.CheckSteal(3, 10, 54));
 }
Пример #5
0
 public void CheckSteal_StealNone()
 {
     Assert.AreEqual(
         "None",
         Steal.CheckSteal(99, 99, 99));
 }
Пример #6
0
 public void CheckSteal_StealRare_EdgeCase()
 {
     Assert.AreEqual(
         "Rare",
         Steal.CheckSteal(2, 0, 0));
 }
Пример #7
0
 public void CheckSteal_StealCommon()
 {
     Assert.AreEqual(
         "Common",
         Steal.CheckSteal(99, 99, 0));
 }
Пример #8
0
 public void CheckSteal_StealUncommon()
 {
     Assert.AreEqual(
         "Uncommon",
         Steal.CheckSteal(99, 0, 0));
 }
Пример #9
0
 public void CheckSteal_StealRare()
 {
     Assert.AreEqual(
         "Rare",
         Steal.CheckSteal(0, 0, 0));
 }
Пример #10
0
        /// <summary>
        /// The purpose of this method is to display to chest information for the future
        /// based on our current location in the RNG
        /// </summary>
        /// <param name="displayRNG">RNG numbers to use</param>
        /// <param name="start">index where our first matching heal is</param>
        /// <param name="rowsToRender">How many rows to display</param>
        private void displayRNGHelper(int start, int rowsToRender, bool firstLoad)
        {
            //Clear datagridview
            mRngGridData.Clear();

            uint firstRNGVal  = mDispRng.genrand();
            uint secondRNGVal = mDispRng.genrand();
            uint thirdRNGVal  = mDispRng.genrand();
            // We want to preserve the character index, since this loop is just for display:
            int indexStatic = mGroup.GetIndex();

            mGroup.ResetIndex();

            int end = start + rowsToRender;

            for (int index = start; index < end; index++)
            {
                // Index starting at 0
                int loopIndex = index - start;

                // Get the heal value once:
                int currentHeal = mGroup.GetHealValue(firstRNGVal);
                int nextHeal    = mGroup.PeekHealValue(secondRNGVal);

                // Put the next expected heal in the text box
                if (index == start + mHealVals.Count - 1)
                {
                    LastHeal = nextHeal;
                }

                // Advance the RNG before starting the loop in case we want to skip an entry
                uint firstRNGVal_temp  = firstRNGVal;
                uint secondRNGVal_temp = secondRNGVal;
                uint thirdRNGVal_temp  = thirdRNGVal;

                firstRNGVal  = secondRNGVal;
                secondRNGVal = thirdRNGVal;
                thirdRNGVal  = mDispRng.genrand();

                // Skip the entry if it's too long ago
                if (loopIndex < mHealVals.Count - HISTORY_TO_DISPLAY)
                {
                    continue;
                }

                RngDataViewModel rngData = new RngDataViewModel
                {
                    Position   = index,
                    Value      = currentHeal,
                    Percent    = firstRNGVal_temp % 100,
                    Steal      = Steal.CheckSteal(firstRNGVal_temp, secondRNGVal_temp, thirdRNGVal_temp),
                    StealCuffs = Steal.CheckStealCuffs(firstRNGVal_temp, secondRNGVal_temp, thirdRNGVal_temp),
                    OneIn256   = firstRNGVal_temp < 0x1000000
                };
                //Start actually displaying
                RngGridData.Add(rngData);
            }
            mGroup.SetIndex(indexStatic);
            if (RngGridData.Count > 0)
            {
                if (firstLoad)
                {
                    SelectedGridRow = RngGridData.Where(x => x.Position == start).FirstOrDefault();
                }
            }
        }
Пример #11
0
 private void handleSteal(uint PRNG0, uint PRNG1, uint PRNG2, int column)
 {
     dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[column].Value = Steal.CheckSteal(PRNG0, PRNG1, PRNG2);
 }