Exemplo n.º 1
0
 public static void CopyCoopPlayers(this MyMwcObjectBuilder_Checkpoint loadFrom, MyMwcObjectBuilder_Checkpoint copyTo)
 {
     if (loadFrom != null && loadFrom.InventoryObjectBuilder != null && loadFrom.InventoryObjectBuilder.InventoryItems != null)
     {
         var result = loadFrom.InventoryObjectBuilder.InventoryItems.Select(s => s.ItemObjectBuilder).OfType <MyMwcObjectBuilder_Player>().Where(s => s.Name.StartsWith(CoopPlayerPrefix));
         foreach (var pl in result.ToArray())
         {
             copyTo.StoreCoopPlayer((MyMwcObjectBuilder_Player)pl.Clone());
         }
     }
 }