public RoadTripMagnitudeResult GetRoadTripMagnitude(Node node) { RoadTripMagnitudeResult result; if (Magnitudes.TryGetValue(node, out result)) { return(result); } result = new RoadTripMagnitudeResult() { Magnitude = 0 }; foreach (var neighbor in node.Neighbors) { int neighborPopulation = GetPopulation(neighbor, node); if (neighborPopulation > result.Magnitude) { result.Node = neighbor; result.Magnitude = neighborPopulation; } } Magnitudes.Add(node, result); return(result); }
public FXEarthquake(GameObject target, Magnitudes magnitude, float range) { this.Target = target; this.Type = Types.EARTHQUAKE; this.magnitude = magnitude; this.pivot = target.transform.position; this.range = range; this.couter = 0; }