Пример #1
0
 private int ConvertTo(Unit toUnit)
 {
     return unit.ConvertTo(value, toUnit);
 }
Пример #2
0
 public int ConvertTo(int value, Unit unit)
 {
     return value*numberOfBaseUnits/unit.numberOfBaseUnits;
 }
Пример #3
0
 private Quantity(int value, Unit unit)
 {
     this.value = value;
     this.unit = unit;
 }
Пример #4
0
 public bool ComparableWith(Unit unit)
 {
     return unitType.Equals(unit.unitType);
 }