A unit graph edge links two units in terms of converting from one unit to another
Ejemplo n.º 1
0
 public UnitGraphEdge AddConversion(UnitGraphNode to, Func<Measure, Measure> edgeToTarget)
 {
     UnitGraphEdge unitGraphEdge;
     var success = targets.TryGetValue(to, out unitGraphEdge);
     if (!success)
         targets.Add(to, unitGraphEdge = new UnitGraphEdge(unit, edgeToTarget, to.Unit));
     return unitGraphEdge;
 }
Ejemplo n.º 2
0
        public UnitGraphEdge AddConversion(UnitGraphNode to, Func <Measure, Measure> edgeToTarget)
        {
            UnitGraphEdge unitGraphEdge;
            var           success = targets.TryGetValue(to, out unitGraphEdge);

            if (!success)
            {
                targets.Add(to, unitGraphEdge = new UnitGraphEdge(unit, edgeToTarget, to.Unit));
            }
            return(unitGraphEdge);
        }
Ejemplo n.º 3
0
 public bool Equals(UnitGraphEdge other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.to, to) && Equals(other.from, from));
 }
Ejemplo n.º 4
0
 public bool Equals(UnitGraphEdge other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.to, to) && Equals(other.from, from);
 }