public CharacterEntity(FileInfo characterFile) : base(null) { MyObjectBuilder_Character character = BaseObjectManager.LoadContentFile <MyObjectBuilder_Character>(characterFile); ObjectBuilder = character; m_inventory = new InventoryEntity(character.Inventory); }
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"; }