/// <summary> /// Returns maximum value of specified property as <see cref="ITerminalProperty.TypeName"/> /// </summary> /// <typeparam name="T">required value type of <see cref="ITerminalProperty.TypeName"/></typeparam> /// <param name="block">block reference</param> /// <param name="propertyId">property id (name)</param> /// <returns>property value as <see cref="ITerminalProperty.TypeName"/></returns> public static T GetMaximum <T>(this Ingame.IMyTerminalBlock block, string propertyId) { return(block.GetProperty(propertyId).Cast <T>().GetMaximum(block)); }
/// <summary> /// Set value of property with type of <see cref="ITerminalProperty.TypeName"/> /// </summary> /// <typeparam name="T"><see cref="ITerminalProperty.TypeName"/></typeparam> /// <param name="block">block reference</param> /// <param name="propertyId">property id (name)</param> /// <param name="value">value to set</param> public static void SetValue <T>(this Ingame.IMyTerminalBlock block, string propertyId, T value) { block.GetProperty(propertyId).Cast <T>().SetValue(block, value); }
/// <summary> /// Returns default value of specified property as <see cref="ITerminalProperty.TypeName"/> /// </summary> /// <typeparam name="T">required value type of <see cref="ITerminalProperty.TypeName"/></typeparam> /// <param name="block">block reference</param> /// <param name="propertyId">property id (name)</param> /// <returns>property value as <see cref="ITerminalProperty.TypeName"/></returns> public static T GetDefaultValue <T>(this Ingame.IMyTerminalBlock block, string propertyId) { return(block.GetProperty(propertyId).Cast <T>().GetDefaultValue(block)); }