Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Properties | Events | List of all members
Sandbox.Game.Entities.Cube.MyGridClipboard Class Reference
Inheritance diagram for Sandbox.Game.Entities.Cube.MyGridClipboard:
Sandbox.Game.Entities.Cube.MyGridClipboardAdvanced Sandbox.Game.Entities.Cube.MyProjectorClipboard Sandbox.Game.Entities.Cube.MyMultiBlockClipboard

Public Member Functions

 MyGridClipboard (MyPlacementSettings settings, bool calculateVelocity=true)
 
MyCubeBlockDefinition GetFirstBlockDefinition (MyObjectBuilder_CubeGrid grid=null)
 
virtual void ActivateNoAlign (Action callback=null)
 
virtual void Activate (Action callback=null)
 
virtual void Deactivate (bool afterPaste=false)
 
void Hide ()
 
void Show ()
 
void ClearClipboard ()
 
void CopyGroup (MyCubeGrid gridInGroup, GridLinkTypeEnum groupType)
 
void CutGrid (MyCubeGrid grid)
 
void CopyGrid (MyCubeGrid grid)
 
void CutGroup (MyCubeGrid grid, GridLinkTypeEnum groupType)
 
virtual bool PasteGrid (MyInventoryBase buildInventory=null, bool deactivate=true)
 
void SetGridFromBuilder (MyObjectBuilder_CubeGrid grid, Vector3 dragPointDelta, float dragVectorLength)
 
void SetGridFromBuilders (MyObjectBuilder_CubeGrid[] grids, Vector3 dragPointDelta, float dragVectorLength)
 
virtual void Update ()
 
virtual bool EntityCanPaste (MyEntity pastingEntity)
 
virtual void UpdateColor (Vector3 newHSV)
 Used to update the color of a new ship/station block when the player switches it More...
 
virtual Matrix GetFirstGridOrientationMatrix ()
 
void AlignClipboardToGravity ()
 
void AlignClipboardToGravity (Vector3 gravity)
 
void DrawHud ()
 
void CalculateRotationHints (MyBlockBuilderRotationHints hints, bool isRotating)
 
bool HasCopiedGrids ()
 
void SaveClipboardAsPrefab (string name=null, string path=null)
 
void HideGridWhenColliding (List< Vector3D > collisionTestPoints)
 
void RotateAroundAxis (int axisIndex, int sign, bool newlyPressed, float angleDelta)
 
virtual void MoveEntityFurther ()
 
virtual void MoveEntityCloser ()
 

Static Public Member Functions

static void CalculateItemRequirements (List< MyObjectBuilder_CubeGrid > blocksToBuild, MyComponentList buildComponents)
 
static void CalculateItemRequirements (MyObjectBuilder_CubeGrid[] blocksToBuild, MyComponentList buildComponents)
 

Public Attributes

bool ShowModdedBlocksWarning = true
 

Protected Member Functions

delegate void UpdateAfterPasteCallback (List< MyObjectBuilder_CubeGrid > pastedBuilders)
 
void ShowPreview (bool show)
 
bool PasteGridInternal (MyInventoryBase buildInventory, bool deactivate, List< MyObjectBuilder_CubeGrid > pastedBuilders=null, List< MyCubeGrid > touchingGrids=null, UpdateAfterPasteCallback updateAfterPasteCallback=null, bool multiBlock=false)
 
bool CheckPastedBlocks ()
 Checks the pasted object builder for non-existent blocks (e.g. copying from world with a cube block mod to a world without it) More...
 
bool CheckPastedScripts ()
 Checks the pasted object builder for scripts inside programmable blocks More...
 
void BeforeCreateGrid (MyObjectBuilder_CubeGrid grid)
 
virtual void ChangeClipboardPreview (bool visible)
 
bool UpdateHitEntity (bool canPasteLargeOnSmall=true)
 
virtual void TestBuildingMaterials ()
 
virtual MyEntity GetClipboardBuilder ()
 
virtual bool TestPlacement ()
 
virtual void UpdateGridTransformations ()
 
virtual void UpdatePastePosition ()
 
void AlignRotationToCoordSys ()
 
bool TrySnapToSurface (SnapMode snapMode)
 
void FixSnapTransformationBase6 ()
 

Static Protected Member Functions

static MatrixD GetPasteMatrix ()
 

Protected Attributes

List< Vector3m_copiedGridOffsets = new List<Vector3>()
 
Vector3D m_pastePosition
 
Vector3D m_pastePositionPrevious
 
bool m_calculateVelocity = true
 
Vector3 m_objectVelocity = Vector3.Zero
 
float m_pasteOrientationAngle = 0.0f
 
Vector3 m_pasteDirUp = new Vector3(1.0f, 0.0f, 0.0f)
 
Vector3 m_pasteDirForward = new Vector3(0.0f, 1.0f, 0.0f)
 
float m_dragDistance
 
const float m_maxDragDistance = 2E4f
 
Vector3 m_dragPointToPositionLocal
 
bool m_canBePlaced
 
bool m_characterHasEnoughMaterials = false
 
MyPlacementSettings m_settings
 
float m_closestHitDistSq = float.MaxValue
 
Vector3D m_hitPos = new Vector3(0.0f, 0.0f, 0.0f)
 
Vector3 m_hitNormal = new Vector3(1.0f, 0.0f, 0.0f)
 
IMyEntity m_hitEntity = null
 
bool m_visible = true
 
bool m_useDynamicPreviews = false
 
Dictionary< string, int > m_blocksPerType = new Dictionary<string,int>()
 
List< MyCubeGridm_touchingGrids = new List<MyCubeGrid>()
 Grids that are around pasted grid. (In proximity, possible for merge) More...
 

Properties

virtual bool CanBePlaced [get]
 
bool CharacterHasEnoughMaterials [get]
 
virtual bool HasPreviewBBox [get, set]
 
bool IsActive [get, protected set]
 
bool AllowSwitchCameraMode [get]
 
bool IsSnapped [get, protected set]
 
List< MyObjectBuilder_CubeGridCopiedGrids [get]
 
SnapMode SnapMode [get]
 
bool EnablePreciseRotationWhenSnapped [get]
 
bool OneAxisRotationMode [get]
 
List< MyCubeGridPreviewGrids [get]
 
virtual bool AnyCopiedGridIsStatic [get]
 
bool EnableStationRotation [get, set]
 
bool CreationMode [get, set]
 
MyCubeSize CubeSize [get, set]
 
bool IsStatic [get, set]
 
virtual float Transparency [get]
 
string CopiedGridsName [get]
 

Events

Action< MyGridClipboard, bool > Deactivated
 

Detailed Description

Definition at line 40 of file MyGridClipboard.cs.

Constructor & Destructor Documentation

Sandbox.Game.Entities.Cube.MyGridClipboard.MyGridClipboard ( MyPlacementSettings  settings,
bool  calculateVelocity = true 
)
inline

Definition at line 260 of file MyGridClipboard.cs.

Member Function Documentation

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.Activate ( Action  callback = null)
inlinevirtual
virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.ActivateNoAlign ( Action  callback = null)
inlinevirtual

Definition at line 282 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.AlignClipboardToGravity ( )
inline

Definition at line 1485 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.AlignClipboardToGravity ( Vector3  gravity)
inline

Definition at line 1499 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.AlignRotationToCoordSys ( )
inlineprotected

Definition at line 1514 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.BeforeCreateGrid ( MyObjectBuilder_CubeGrid  grid)
inlineprotected

Definition at line 940 of file MyGridClipboard.cs.

static void Sandbox.Game.Entities.Cube.MyGridClipboard.CalculateItemRequirements ( List< MyObjectBuilder_CubeGrid blocksToBuild,
MyComponentList  buildComponents 
)
inlinestatic

Definition at line 1065 of file MyGridClipboard.cs.

static void Sandbox.Game.Entities.Cube.MyGridClipboard.CalculateItemRequirements ( MyObjectBuilder_CubeGrid[]  blocksToBuild,
MyComponentList  buildComponents 
)
inlinestatic

Definition at line 1088 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.CalculateRotationHints ( MyBlockBuilderRotationHints  hints,
bool  isRotating 
)
inline

Definition at line 1763 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.ChangeClipboardPreview ( bool  visible)
inlineprotectedvirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyMultiBlockClipboard.

Definition at line 956 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.CheckPastedBlocks ( )
inlineprotected

Checks the pasted object builder for non-existent blocks (e.g. copying from world with a cube block mod to a world without it)

Returns
True when the grid can be pasted

Definition at line 840 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.CheckPastedScripts ( )
inlineprotected

Checks the pasted object builder for scripts inside programmable blocks

Returns

Definition at line 861 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.ClearClipboard ( )
inline

Definition at line 464 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.CopyGrid ( MyCubeGrid  grid)
inline

Definition at line 550 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.CopyGroup ( MyCubeGrid  gridInGroup,
GridLinkTypeEnum  groupType 
)
inline

Definition at line 472 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.CutGrid ( MyCubeGrid  grid)
inline

Definition at line 540 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.CutGroup ( MyCubeGrid  grid,
GridLinkTypeEnum  groupType 
)
inline

Definition at line 559 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.Deactivate ( bool  afterPaste = false)
inlinevirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyMultiBlockClipboard.

Definition at line 393 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.DrawHud ( )
inline

Definition at line 1754 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.EntityCanPaste ( MyEntity  pastingEntity)
inlinevirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyMultiBlockClipboard.

Definition at line 1275 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.FixSnapTransformationBase6 ( )
inlineprotected

Definition at line 1639 of file MyGridClipboard.cs.

virtual MyEntity Sandbox.Game.Entities.Cube.MyGridClipboard.GetClipboardBuilder ( )
inlineprotectedvirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyProjectorClipboard.

Definition at line 1270 of file MyGridClipboard.cs.

MyCubeBlockDefinition Sandbox.Game.Entities.Cube.MyGridClipboard.GetFirstBlockDefinition ( MyObjectBuilder_CubeGrid  grid = null)
inline

Definition at line 266 of file MyGridClipboard.cs.

virtual Matrix Sandbox.Game.Entities.Cube.MyGridClipboard.GetFirstGridOrientationMatrix ( )
inlinevirtual

Definition at line 1480 of file MyGridClipboard.cs.

static MatrixD Sandbox.Game.Entities.Cube.MyGridClipboard.GetPasteMatrix ( )
inlinestaticprotected

Definition at line 1467 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.HasCopiedGrids ( )
inline

Definition at line 1816 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.Hide ( )
inline

Definition at line 412 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.HideGridWhenColliding ( List< Vector3D collisionTestPoints)
inline

Definition at line 1853 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.MoveEntityCloser ( )
inlinevirtual
virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.MoveEntityFurther ( )
inlinevirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyMultiBlockClipboard.

Definition at line 1977 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.PasteGrid ( MyInventoryBase  buildInventory = null,
bool  deactivate = true 
)
inlinevirtual
bool Sandbox.Game.Entities.Cube.MyGridClipboard.PasteGridInternal ( MyInventoryBase  buildInventory,
bool  deactivate,
List< MyObjectBuilder_CubeGrid pastedBuilders = null,
List< MyCubeGrid touchingGrids = null,
UpdateAfterPasteCallback  updateAfterPasteCallback = null,
bool  multiBlock = false 
)
inlineprotected

Definition at line 613 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.RotateAroundAxis ( int  axisIndex,
int  sign,
bool  newlyPressed,
float  angleDelta 
)
inline

Definition at line 1877 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.SaveClipboardAsPrefab ( string  name = null,
string  path = null 
)
inline

Definition at line 1834 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.SetGridFromBuilder ( MyObjectBuilder_CubeGrid  grid,
Vector3  dragPointDelta,
float  dragVectorLength 
)
inline

Definition at line 882 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.SetGridFromBuilders ( MyObjectBuilder_CubeGrid[]  grids,
Vector3  dragPointDelta,
float  dragVectorLength 
)
inline

Definition at line 897 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.Show ( )
inline

Definition at line 420 of file MyGridClipboard.cs.

void Sandbox.Game.Entities.Cube.MyGridClipboard.ShowPreview ( bool  show)
inlineprotected

Definition at line 432 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.TestBuildingMaterials ( )
inlineprotectedvirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyProjectorClipboard.

Definition at line 1265 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.TestPlacement ( )
inlineprotectedvirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyProjectorClipboard.

Definition at line 1286 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.TrySnapToSurface ( SnapMode  snapMode)
inlineprotected

Definition at line 1527 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.Update ( )
inlinevirtual
delegate void Sandbox.Game.Entities.Cube.MyGridClipboard.UpdateAfterPasteCallback ( List< MyObjectBuilder_CubeGrid pastedBuilders)
protected
virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.UpdateColor ( Vector3  newHSV)
inlinevirtual

Used to update the color of a new ship/station block when the player switches it

Definition at line 1452 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.UpdateGridTransformations ( )
inlineprotectedvirtual

Reimplemented in Sandbox.Game.Entities.Cube.MyProjectorClipboard.

Definition at line 1379 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.UpdateHitEntity ( bool  canPasteLargeOnSmall = true)
inlineprotected

Definition at line 1205 of file MyGridClipboard.cs.

virtual void Sandbox.Game.Entities.Cube.MyGridClipboard.UpdatePastePosition ( )
inlineprotectedvirtual

Member Data Documentation

Dictionary<string, int> Sandbox.Game.Entities.Cube.MyGridClipboard.m_blocksPerType = new Dictionary<string,int>()
protected

Definition at line 106 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.m_calculateVelocity = true
protected

Definition at line 63 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.m_canBePlaced
protected

Definition at line 77 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.m_characterHasEnoughMaterials = false
protected

Definition at line 89 of file MyGridClipboard.cs.

float Sandbox.Game.Entities.Cube.MyGridClipboard.m_closestHitDistSq = float.MaxValue
protected

Definition at line 96 of file MyGridClipboard.cs.

List<Vector3> Sandbox.Game.Entities.Cube.MyGridClipboard.m_copiedGridOffsets = new List<Vector3>()
protected

Definition at line 53 of file MyGridClipboard.cs.

float Sandbox.Game.Entities.Cube.MyGridClipboard.m_dragDistance
protected

Definition at line 72 of file MyGridClipboard.cs.

Vector3 Sandbox.Game.Entities.Cube.MyGridClipboard.m_dragPointToPositionLocal
protected

Definition at line 74 of file MyGridClipboard.cs.

IMyEntity Sandbox.Game.Entities.Cube.MyGridClipboard.m_hitEntity = null
protected

Definition at line 99 of file MyGridClipboard.cs.

Vector3 Sandbox.Game.Entities.Cube.MyGridClipboard.m_hitNormal = new Vector3(1.0f, 0.0f, 0.0f)
protected

Definition at line 98 of file MyGridClipboard.cs.

Vector3D Sandbox.Game.Entities.Cube.MyGridClipboard.m_hitPos = new Vector3(0.0f, 0.0f, 0.0f)
protected

Definition at line 97 of file MyGridClipboard.cs.

const float Sandbox.Game.Entities.Cube.MyGridClipboard.m_maxDragDistance = 2E4f
protected

Definition at line 73 of file MyGridClipboard.cs.

Vector3 Sandbox.Game.Entities.Cube.MyGridClipboard.m_objectVelocity = Vector3.Zero
protected

Definition at line 64 of file MyGridClipboard.cs.

Vector3 Sandbox.Game.Entities.Cube.MyGridClipboard.m_pasteDirForward = new Vector3(0.0f, 1.0f, 0.0f)
protected

Definition at line 69 of file MyGridClipboard.cs.

Vector3 Sandbox.Game.Entities.Cube.MyGridClipboard.m_pasteDirUp = new Vector3(1.0f, 0.0f, 0.0f)
protected

Definition at line 68 of file MyGridClipboard.cs.

float Sandbox.Game.Entities.Cube.MyGridClipboard.m_pasteOrientationAngle = 0.0f
protected

Definition at line 67 of file MyGridClipboard.cs.

Vector3D Sandbox.Game.Entities.Cube.MyGridClipboard.m_pastePosition
protected

Definition at line 59 of file MyGridClipboard.cs.

Vector3D Sandbox.Game.Entities.Cube.MyGridClipboard.m_pastePositionPrevious
protected

Definition at line 60 of file MyGridClipboard.cs.

MyPlacementSettings Sandbox.Game.Entities.Cube.MyGridClipboard.m_settings
protected

Definition at line 92 of file MyGridClipboard.cs.

List<MyCubeGrid> Sandbox.Game.Entities.Cube.MyGridClipboard.m_touchingGrids = new List<MyCubeGrid>()
protected

Grids that are around pasted grid. (In proximity, possible for merge)

Definition at line 111 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.m_useDynamicPreviews = false
protected

Definition at line 104 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.m_visible = true
protected

Definition at line 101 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.ShowModdedBlocksWarning = true

Definition at line 258 of file MyGridClipboard.cs.

Property Documentation

bool Sandbox.Game.Entities.Cube.MyGridClipboard.AllowSwitchCameraMode
get

Definition at line 140 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.AnyCopiedGridIsStatic
getprotected

Definition at line 195 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.CanBePlaced
getprotected

Definition at line 79 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.CharacterHasEnoughMaterials
get

Definition at line 90 of file MyGridClipboard.cs.

List<MyObjectBuilder_CubeGrid> Sandbox.Game.Entities.Cube.MyGridClipboard.CopiedGrids
get

Definition at line 152 of file MyGridClipboard.cs.

string Sandbox.Game.Entities.Cube.MyGridClipboard.CopiedGridsName
get

Definition at line 1822 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.CreationMode
getset

Definition at line 242 of file MyGridClipboard.cs.

MyCubeSize Sandbox.Game.Entities.Cube.MyGridClipboard.CubeSize
getset

Definition at line 248 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.EnablePreciseRotationWhenSnapped
get

Definition at line 170 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.EnableStationRotation
getset

Definition at line 214 of file MyGridClipboard.cs.

virtual bool Sandbox.Game.Entities.Cube.MyGridClipboard.HasPreviewBBox
getset

Definition at line 122 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.IsActive
getprotected set

Definition at line 134 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.IsSnapped
getprotected set

Definition at line 146 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.IsStatic
getset

Definition at line 254 of file MyGridClipboard.cs.

bool Sandbox.Game.Entities.Cube.MyGridClipboard.OneAxisRotationMode
get

Definition at line 182 of file MyGridClipboard.cs.

List<MyCubeGrid> Sandbox.Game.Entities.Cube.MyGridClipboard.PreviewGrids
get

Definition at line 190 of file MyGridClipboard.cs.

SnapMode Sandbox.Game.Entities.Cube.MyGridClipboard.SnapMode
get

Definition at line 158 of file MyGridClipboard.cs.

virtual float Sandbox.Game.Entities.Cube.MyGridClipboard.Transparency
getprotected

Definition at line 1124 of file MyGridClipboard.cs.

Event Documentation

Action<MyGridClipboard, bool> Sandbox.Game.Entities.Cube.MyGridClipboard.Deactivated

Definition at line 119 of file MyGridClipboard.cs.


The documentation for this class was generated from the following file: