private string GenerateCubeNodeText( MyCubeGrid item ) { string text = item.DisplayName??"Ship"; int sortBy = CB_Entity_Sort.SelectedIndex; switch ( sortBy ) { case 0: //text += $" | {item.Name}"; break; case 1: text += $" | {(string.IsNullOrEmpty(item.GetOwner()) ? "No Owner" : $"Owner: {item.GetOwner()}")}"; break; case 2: text += $" | Blocks: {item.BlocksCount}"; break; case 4: text += $" | Mass: {((item.Physics == null || item.Physics.IsStatic) ? "[Station]" : Math.Floor(item.Physics.Mass) + "kg")}"; break; case 5: text += $" | EntityID: {item.EntityId}"; break; } text += string.Format( " | Dist: {0}m", Math.Round( ( (Vector3D)item.PositionComp.GetPosition() ).Length( ), 0 ) ); return text; }