void ModAPI.Interfaces.ITerminalAction.WriteValue(VRage.Game.ModAPI.Ingame.IMyCubeBlock block, StringBuilder appendTo)
 {
     if (block is TBlock)
     {
         WriteValue(block as MyTerminalBlock, appendTo);
     }
 }
 void ModAPI.Interfaces.ITerminalAction.Apply(VRage.Game.ModAPI.Ingame.IMyCubeBlock block, ListReader <TerminalActionParameter> parameters)
 {
     if (block is TBlock)
     {
         Apply(block as MyTerminalBlock, parameters);
     }
 }
 void ModAPI.Interfaces.ITerminalAction.Apply(VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
 {
     if (block is TBlock)
     {
         Apply(block as MyTerminalBlock);
     }
 }
 bool ModAPI.Interfaces.ITerminalAction.IsEnabled(VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
 {
     if (block is TBlock)
     {
         return(IsEnabled(block as MyTerminalBlock));
     }
     return(false);
 }
Exemple #5
0
        /// <summary>
        /// Determines if the given block is an autopilot block. Does not check ServerSettings.
        /// </summary>
        /// <param name="block">The block to check</param>
        /// <returns>True iff the given block is an autopilot block.</returns>
        public static bool IsAutopilotBlock(VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
        {
            if (block is MyCockpit)
            {
                return(block.BlockDefinition.SubtypeId.Contains(subtype_autopilotBlock));
            }

            return(block is MyRemoteControl);
        }
Exemple #6
0
        /// <remarks>
        /// Different from the others because share mode matters.
        /// </remarks>
        public static bool canControlBlock(this long ownerId, VRage.Game.ModAPI.Ingame.IMyCubeBlock target)
        {
            switch (target.GetUserRelationToOwner(ownerId))
            {
            case MyRelationsBetweenPlayerAndBlock.Enemies:
            case MyRelationsBetweenPlayerAndBlock.Neutral:
                return(false);

            case MyRelationsBetweenPlayerAndBlock.FactionShare:
            case MyRelationsBetweenPlayerAndBlock.Owner:
                return(true);

            case MyRelationsBetweenPlayerAndBlock.NoOwnership:
            default:
                return(target.OwnerId == 0);
            }
        }
Exemple #7
0
 public static float GetLargestSide(this VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
 {
     return((block.Max - block.Min).AbsMax() * block.CubeGrid.GridSize);
 }
 public TValue GetMaximum(VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
 {
     return(GetMaximum(((TBlock)block)));
 }
 public TValue GetDefaultValue(VRage.Game.ModAPI.Ingame.IMyCubeBlock block)
 {
     return(GetDefaultValue(((TBlock)block)));
 }
 public void SetValue(VRage.Game.ModAPI.Ingame.IMyCubeBlock block, TValue value)
 {
     SetValue(((TBlock)block), value);
 }
Exemple #11
0
 /// <remarks>
 /// Different from the others because share mode matters.
 /// </remarks>
 public static bool canControlBlock(this VRage.Game.ModAPI.Ingame.IMyCubeBlock block, VRage.Game.ModAPI.Ingame.IMyCubeBlock target)
 {
     return(canControlBlock(block.OwnerId, target));
 }
Exemple #12
0
 public abstract void Init(VRage.Game.ModAPI.Ingame.IMyCubeBlock block);