kOS.Suffixed.VesselTarget.GetSuffix C# (CSharp) Method

GetSuffix() public method

public GetSuffix ( string suffixName ) : ISuffixResult
suffixName string
return ISuffixResult
        public override ISuffixResult GetSuffix(string suffixName)
        {
            // Most suffixes are handled by the newer AddSuffix system, except for the
            // resource levels, which have to use this older technique as a fallback because
            // the AddSuffix system doesn't support this type of late-binding string matching:

            // Is this a resource?
            double dblValue;
            if (VesselUtils.TryGetResource(Vessel, suffixName, out dblValue))
            {
                return new SuffixResult(ScalarValue.Create(dblValue));
            }

            return base.GetSuffix(suffixName);
        }