コード例 #1
0
 public void Arithmetic()
 {
     Assert.AreEqual(-Ounce.S(4), -(Pint.S(0.25)));
     Assert.AreEqual(Cup.S(1), Ounce.S(4) + Pint.S(0.25));
     Assert.AreEqual(Pint.S(-0.25), Quart.S(0.25) - Ounce.S(12));
     Assert.AreEqual(-Foot.S(3), Inch.Es(36) - Yard.S(2));
 }
コード例 #2
0
 public void Quantity()
 {
     RatioQuantity[] quantities =
     {
         Teaspoon.S(10), Quart.S(1), Tablespoon.S(6), Ounce.S(13)
     };
     Assert.AreEqual(Pint.S(2), Sequence.Max(quantities));
 }
コード例 #3
0
    public void Fill(Pint pint)
    {
        if (pint.filling < pint.capacity)
        {
            pint.filling += mLPerSeconds * Time.deltaTime;
        }

        //Debug.Log("filling " + pint.filling);
    }
コード例 #4
0
        public void Quantity()
        {
            var quantities = new List <IntervalQuantity>
            {
                Teaspoon.S(10), Quart.S(1), Tablespoon.S(6), Ounce.S(13)
            };

            Assert.AreEqual(Pint.S(2), Sequence.Best(quantities));
        }
コード例 #5
0
 public static RatioQuantity Pints(this int amount) => Pint.S(amount);