public CubeGridEntity(MyObjectBuilder_CubeGrid definition) : base(definition) { _cubeBlockManager = new CubeBlockManager(this); List <CubeBlockEntity> cubeBlockList = new List <CubeBlockEntity>( ); foreach (MyObjectBuilder_CubeBlock cubeBlock in definition.CubeBlocks) { cubeBlock.EntityId = 0; cubeBlockList.Add(new CubeBlockEntity(this, cubeBlock)); } _cubeBlockManager.Load(cubeBlockList); _lastNameRefresh = DateTime.Now; _name = "Cube Grid"; }
public CubeGridEntity(FileInfo prefabFile) : base(BaseObjectManager.LoadContentFile <MyObjectBuilder_CubeGrid, MyObjectBuilder_CubeGridSerializer>(prefabFile)) { EntityId = 0; ObjectBuilder.EntityId = 0; if (ObjectBuilder.PositionAndOrientation != null) { PositionAndOrientation = ObjectBuilder.PositionAndOrientation.GetValueOrDefault( ); } _cubeBlockManager = new CubeBlockManager(this); List <CubeBlockEntity> cubeBlockList = new List <CubeBlockEntity>( ); foreach (MyObjectBuilder_CubeBlock cubeBlock in ObjectBuilder.CubeBlocks) { cubeBlock.EntityId = 0; cubeBlockList.Add(new CubeBlockEntity(this, cubeBlock)); } _cubeBlockManager.Load(cubeBlockList); _lastNameRefresh = DateTime.Now; _name = "Cube Grid"; }