private void OnPropertiesChanged(IMyTerminalBlock turret) { float range = turret.GetValue <float>("Range"); if (Light_Radius != (range + 20)) { // set radius to aiming radius + 20 SetServerTurretLightRadius(range + 20); } }
public static bool isOn(IMyTerminalBlock block) { var prop = block.GetProperty("OnOff"); if (prop != null) { return(block.GetValue <bool>("OnOff") && block.IsFunctional); } return(block.IsFunctional); }
public static float GetValueFloat(this IMyTerminalBlock block, string propertyId) => block.GetValue <float>(propertyId);
public static Color GetValueColor(this IMyTerminalBlock block, string propertyId) => block.GetValue <Color>(propertyId);
public static bool GetValueBool(this IMyTerminalBlock block, string propertyId) => block.GetValue <bool>(propertyId);
/// <summary> /// Ziskani hodnoty vlastnosti /// </summary> /// <param name="block">Blok</param> /// <param name="property">Vlastnost</param> public static V GetValue <V>(IMyTerminalBlock block, string property) { return(block.GetValue <V>(property)); }