示例#1
0
        public void ProductionCalculator_GetProductionValues_WithBonus_Test()
        {
            var frameTime = TimeSpan.FromMinutes(5);
            var unitTime  = TimeSpan.FromMinutes(5 * 100);
            var values    = ProductionCalculator.GetProductionValues(frameTime, 100, 700.0, 26.4, 3.0, 5.0, unitTime);

            Assert.AreEqual(2.88, values.UPD);
            Assert.AreEqual(19.5, values.Multiplier, 0.01);
            Assert.AreEqual(13648.383, values.Credit);
            Assert.AreEqual(39307.35, values.PPD, 0.01);
        }
示例#2
0
        public void ProductionCalculator_GetProductionValues_NoBonus_Test()
        {
            var frameTime = TimeSpan.FromMinutes(5);
            var unitTime  = TimeSpan.Zero;
            var values    = ProductionCalculator.GetProductionValues(frameTime, 100, 700.0, 26.4, 3.0, 5.0, unitTime);

            Assert.AreEqual(2.88, values.UPD);
            Assert.AreEqual(1.0, values.Multiplier);
            Assert.AreEqual(700.0, values.Credit);
            Assert.AreEqual(2016.0, values.PPD);
        }
 /// <summary>
 /// Gets all production measurements based the given frame time, work unit information, and the unit completion time.
 /// </summary>
 /// <param name="protein"></param>
 /// <param name="frameTime">The work unit frame time.</param>
 /// <param name="unitTime">The overall unit completion time.</param>
 /// <returns>The production measurements for the work unit.</returns>
 public static ProductionValues GetProductionValues(this Protein protein, TimeSpan frameTime, TimeSpan unitTime)
 {
     return(ProductionCalculator.GetProductionValues(frameTime, protein.Frames, protein.Credit, protein.KFactor, protein.PreferredDays, protein.MaximumDays, unitTime));
 }