Пример #1
0
        public void InitializeTiles <T>(List <T> tileInfos) where T : ITileView
        {
            Action action;

            HeavyActionsBunchesExecutor heavyActionsBunchesExecutor = _heavyActionsBunchesExecutorFactory.Invoke();

            heavyActionsBunchesExecutor.Initialize(4);

            foreach (ITileView tileInfo in tileInfos)
            {
                action = () => InitializeTile(tileInfo);
                heavyActionsBunchesExecutor.AddAction(action);
            }

            heavyActionsBunchesExecutor.Execute();
        }
Пример #2
0
        public void DestroyTiles <T>(List <T> tileInfos) where T : ITileView
        {
            Action action;
            HeavyActionsBunchesExecutor heavyActionsBunchesExecutor = _heavyActionsBunchesExecutorFactory.Invoke();

            heavyActionsBunchesExecutor.Initialize(4);

            foreach (ITileView tileInfo in tileInfos)
            {
                action = () =>
                {
                    _mapViewController.DestroyTile(tileInfo.ViewPosition);
                    _initializedIndexes.Remove(tileInfo.ViewPosition);
                };
                heavyActionsBunchesExecutor.AddAction(action);
            }

            heavyActionsBunchesExecutor.Execute();
        }