public static IStructureBase Create(MyObjectBuilder_EntityBase entityBase, string savefilePath)
{
if (entityBase is MyObjectBuilder_Planet)
{
return new StructurePlanetModel(entityBase, savefilePath);
}
if (entityBase is MyObjectBuilder_VoxelMap)
{
return new StructureVoxelModel(entityBase, savefilePath);
}
if (entityBase is MyObjectBuilder_Character)
{
return new StructureCharacterModel(entityBase);
}
if (entityBase is MyObjectBuilder_CubeGrid)
{
return new StructureCubeGridModel(entityBase);
}
if (entityBase is MyObjectBuilder_FloatingObject)
{
return new StructureFloatingObjectModel(entityBase);
}
if (entityBase is MyObjectBuilder_Meteor)
{
return new StructureMeteorModel(entityBase);
}
if (entityBase is MyObjectBuilder_InventoryBagEntity)
{
return new StructureInventoryBagModel(entityBase);
}
return new StructureUnknownModel(entityBase);
//throw new NotImplementedException(string.Format("A new object has not been catered for in the StructureBase, of type '{0}'.", entityBase.GetType()));
}