Class MyCompoundCubeBlock
Cube block which is composed of several cube blocks together with shared compound template name.
Inheritance
System.Object
MyCompoundCubeBlock
Assembly: Sandbox.Game.dll
Syntax
[MyCubeBlockType]
public class MyCompoundCubeBlock : MyCubeBlock, IMyComponentOwner<MyIDModule>, IMyUpgradableBlock, IMyCubeBlock, IMyEntity, IMyUpgradableBlock, IMyCubeBlock, IMyEntity, IMyDecalProxy
Constructors
MyCompoundCubeBlock()
Declaration
public MyCompoundCubeBlock()
Methods
Add(MySlimBlock, out UInt16)
Adds block to compound (should be used on server only and for generated blocks on local).
Declaration
public bool Add(MySlimBlock block, out ushort id)
Parameters
Type |
Name |
Description |
Sandbox.Game.Entities.Cube.MySlimBlock |
block |
|
System.UInt16 |
id |
|
Returns
Type |
Description |
System.Boolean |
true if the block has been addded, otherwise false
|
Add(UInt16, MySlimBlock)
Adds block to compound (should be used for clients).
Declaration
public bool Add(ushort id, MySlimBlock block)
Parameters
Type |
Name |
Description |
System.UInt16 |
id |
|
Sandbox.Game.Entities.Cube.MySlimBlock |
block |
|
Returns
Type |
Description |
System.Boolean |
true if the block has been addded, otherwise false
|
CanAddBlock(MyCubeBlockDefinition, Nullable<MyBlockOrientation>, Int32, Boolean)
Declaration
public bool CanAddBlock(MyCubeBlockDefinition definition, Nullable<MyBlockOrientation> orientation, int multiBlockId = 0, bool ignoreSame = false)
Parameters
Returns
Type |
Description |
System.Boolean |
|
CanAddBlock(MySlimBlock)
Declaration
public bool CanAddBlock(MySlimBlock block)
Parameters
Type |
Name |
Description |
Sandbox.Game.Entities.Cube.MySlimBlock |
block |
|
Returns
Type |
Description |
System.Boolean |
|
CanAddBlocks(MyCubeBlockDefinition, MyBlockOrientation, MyCubeBlockDefinition, MyBlockOrientation)
Declaration
public static bool CanAddBlocks(MyCubeBlockDefinition definition, MyBlockOrientation orientation, MyCubeBlockDefinition otherDefinition, MyBlockOrientation otherOrientation)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Closing()
Declaration
protected override void Closing()
Overrides
ConnectionAllowed(ref Vector3I, ref Vector3I, MyCubeBlockDefinition)
Declaration
public override bool ConnectionAllowed(ref Vector3I otherBlockPos, ref Vector3I faceNormal, MyCubeBlockDefinition def)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
ConnectionAllowed(ref Vector3I, ref Vector3I, ref Vector3I, MyCubeBlockDefinition)
Declaration
public override bool ConnectionAllowed(ref Vector3I otherBlockMinPos, ref Vector3I otherBlockMaxPos, ref Vector3I faceNormal, MyCubeBlockDefinition def)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
CreateBuilder(List<MyObjectBuilder_CubeBlock>)
Returns compound cube block builder which includes given blocks.
Declaration
public static MyObjectBuilder_CompoundCubeBlock CreateBuilder(List<MyObjectBuilder_CubeBlock> cubeBlockBuilders)
Parameters
Returns
CreateBuilder(MyObjectBuilder_CubeBlock)
Returns compound cube block builder which includes the given block.
Declaration
public static MyObjectBuilder_CompoundCubeBlock CreateBuilder(MyObjectBuilder_CubeBlock cubeBlockBuilder)
Parameters
Returns
GetBlock(UInt16)
Declaration
public MySlimBlock GetBlock(ushort id)
Parameters
Type |
Name |
Description |
System.UInt16 |
id |
|
Returns
Type |
Description |
Sandbox.Game.Entities.Cube.MySlimBlock |
|
GetBlockId(MySlimBlock)
Declaration
public Nullable<ushort> GetBlockId(MySlimBlock block)
Parameters
Type |
Name |
Description |
Sandbox.Game.Entities.Cube.MySlimBlock |
block |
|
Returns
Type |
Description |
System.Nullable<System.UInt16> |
|
GetBlocks()
Declaration
public ListReader<MySlimBlock> GetBlocks()
Returns
Type |
Description |
ListReader<Sandbox.Game.Entities.Cube.MySlimBlock> |
|
GetBlocksCount()
Declaration
public int GetBlocksCount()
Returns
Type |
Description |
System.Int32 |
|
GetCompoundCubeBlockDefinition()
Declaration
public static MyCubeBlockDefinition GetCompoundCubeBlockDefinition()
Returns
GetGeometryLocalBox()
Declaration
public override BoundingBox GetGeometryLocalBox()
Returns
Overrides
GetIntersectionWithLine(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, out UInt16, IntersectionFlags, Boolean, Boolean)
Declaration
public bool GetIntersectionWithLine(ref LineD line, out Nullable<MyIntersectionResultLineTriangleEx> t, out ushort blockId, IntersectionFlags flags, bool checkZFight = false, bool ignoreGenerated = false)
Parameters
Type |
Name |
Description |
LineD |
line |
|
System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> |
t |
|
System.UInt16 |
blockId |
|
IntersectionFlags |
flags |
|
System.Boolean |
checkZFight |
|
System.Boolean |
ignoreGenerated |
|
Returns
Type |
Description |
System.Boolean |
|
GetIntersectionWithLine_FullyBuiltProgressModels(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, out UInt16, IntersectionFlags, Boolean, Boolean)
Calculates intersected block with all models replaced by final models. Useful for construction/deconstruction when models are made from wooden construction.
Declaration
public bool GetIntersectionWithLine_FullyBuiltProgressModels(ref LineD line, out Nullable<MyIntersectionResultLineTriangleEx> t, out ushort blockId, IntersectionFlags flags, bool checkZFight = false, bool ignoreGenerated = false)
Parameters
Type |
Name |
Description |
LineD |
line |
|
System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> |
t |
|
System.UInt16 |
blockId |
|
IntersectionFlags |
flags |
|
System.Boolean |
checkZFight |
|
System.Boolean |
ignoreGenerated |
|
Returns
Type |
Description |
System.Boolean |
|
GetMass()
Declaration
public override float GetMass()
Returns
Type |
Description |
System.Single |
|
Overrides
GetObjectBuilderCubeBlock(Boolean)
Declaration
public override MyObjectBuilder_CubeBlock GetObjectBuilderCubeBlock(bool copy = false)
Parameters
Type |
Name |
Description |
System.Boolean |
copy |
|
Returns
Overrides
Init(MyObjectBuilder_CubeBlock, MyCubeGrid)
Declaration
public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
Parameters
Overrides
IsCompoundEnabled(MyCubeBlockDefinition)
Declaration
public static bool IsCompoundEnabled(MyCubeBlockDefinition blockDefinition)
Parameters
Returns
Type |
Description |
System.Boolean |
|
OnAddedToScene(Object)
Declaration
public override void OnAddedToScene(object source)
Parameters
Type |
Name |
Description |
System.Object |
source |
|
Overrides
OnCubeGridChanged(MyCubeGrid)
Declaration
public override void OnCubeGridChanged(MyCubeGrid oldGrid)
Parameters
Overrides
OnRemovedFromScene(Object)
Declaration
public override void OnRemovedFromScene(object source)
Parameters
Type |
Name |
Description |
System.Object |
source |
|
Overrides
Remove(MySlimBlock, Boolean)
Declaration
public bool Remove(MySlimBlock block, bool merged = false)
Parameters
Type |
Name |
Description |
Sandbox.Game.Entities.Cube.MySlimBlock |
block |
|
System.Boolean |
merged |
|
Returns
Type |
Description |
System.Boolean |
|
Remove(UInt16, Boolean)
Declaration
public bool Remove(ushort blockId, bool merged = false)
Parameters
Type |
Name |
Description |
System.UInt16 |
blockId |
|
System.Boolean |
merged |
|
Returns
Type |
Description |
System.Boolean |
|
UpdateVisual()
Declaration
public override void UpdateVisual()
Overrides
Explicit Interface Implementations
IMyDecalProxy.AddDecals(ref MyHitInfo, MyStringHash, Vector3, Object, IMyDecalHandler, MyStringHash, MyStringHash, Boolean, MyDecalFlags, Int32, List<UInt32>)
Declaration
void IMyDecalProxy.AddDecals(ref MyHitInfo hitInfo, MyStringHash source, Vector3 forwardDirection, object customdata, IMyDecalHandler decalHandler, MyStringHash physicalMaterial, MyStringHash voxelMaterial, bool isTrail, MyDecalFlags flags, int aliveUntil, List<uint> decals)
Parameters
Implements
Extension Methods