Exemple #1
0
 /// <summary>
 /// Use to get all tiles, when order does not matter.
 /// </summary>
 /// <param name="callback"></param>
 public void BeginGetAllTiles_Parallel(Action <MTileDescription> callback)
 {
     MArrayInfo.BeginGetAll(ArrayInfo, (index) =>
     {
         Parallel.ForEach(TileDescriptions, (td) =>
         {
             var tile      = (MTileDescription)td.Clone();
             tile.CentreX += index.XInfo.Offset;
             tile.CentreY += index.YInfo.Offset;
             callback(tile);
         });
     });
 }
Exemple #2
0
 /// <summary>
 /// Use to get all tiles.
 /// </summary>
 /// <param name="callback"></param>
 public void BeginGetAllTiles(Action <MTileDescription> callback)
 {
     MArrayInfo.BeginGetAll(ArrayInfo, (index) =>
     {
         foreach (var td in TileDescriptions)
         {
             var tile      = (MTileDescription)td.Clone();
             tile.CentreX += index.XInfo.Offset;
             tile.CentreY += index.YInfo.Offset;
             callback(tile);
         }
     });
 }
Exemple #3
0
        /// <summary>
        /// Use to get all layers.
        /// </summary>
        /// <param name="callback"></param>
        public void BeginGetAllLayers(Action <MRecipeDeviceLayer> callback)
        {
            MArrayInfo.BeginGetAll(ArrayInfo, (index) =>
            {
                foreach (var l in Layers)
                {
                    var layer = (MRecipeDeviceLayer)l.Clone();

                    layer.TransformInfo.OffsetX += index.XInfo.Offset;
                    layer.TransformInfo.OffsetY += index.YInfo.Offset;
                    layer.TransformInfo.OffsetZ += index.ZInfo.Offset;

                    callback(layer);
                }
            });
        }
Exemple #4
0
        /// <summary>
        /// Use to get all devices.
        /// </summary>
        /// <param name="callback"></param>
        public void BeginGetAllDevices(Action <MRecipeDevice> callback)
        {
            MArrayInfo.BeginGetAll(ArrayInfo, (index) =>
            {
                foreach (var d in Devices)
                {
                    var device = (MRecipeDevice)d.Clone();

                    device.TransformInfo.OffsetX += index.XInfo.Offset;
                    device.TransformInfo.OffsetY += index.YInfo.Offset;
                    device.TransformInfo.OffsetZ += index.ZInfo.Offset;

                    callback(device);
                }
            });
        }