public DamageWarhead(List <TextNode> nodes) { var fields = TypeLoader.GetFields(this); foreach (var node in nodes) { switch (node.Key) { case nameof(ArmorModifiers): foreach (var node2 in node.Children) { ArmorModifiers.Add(node2.Key, node2.Convert <float>()); } break; default: TypeLoader.SetValue(this, fields, node); break; } } if (RangeSteps.Length != Falloff.Length) { throw new InvalidNodeException($"Range step length ({RangeSteps.Length}) does not match with given falloff values ({Falloff.Length})."); } maxRange = FalloffHelper.GetMax(Falloff, RangeSteps); }
public ForceWarhead(List <TextNode> nodes) { TypeLoader.SetValues(this, nodes); if (RangeSteps.Length != Falloff.Length) { throw new InvalidNodeException($"Range step length ({RangeSteps.Length}) does not match with given falloff values ({Falloff.Length})."); } maxRange = FalloffHelper.GetMax(Falloff, RangeSteps); }