using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ZionRobot.Models.Items;

namespace ZionRobot.Persistence
{
	// Token: 0x02000020 RID: 32
	public class Queues
	{
		// Token: 0x1700003F RID: 63
		// (get) Token: 0x060000BB RID: 187 RVA: 0x00005D10 File Offset: 0x00003F10
		internal List<ZionRobot.Models.Items.File> Files
		{
			get
			{
				bool flag = this.files == null;
				if (flag)
				{
					this.files = new List<ZionRobot.Models.Items.File>();
				}
				this.files.RemoveAll((ZionRobot.Models.Items.File file) => !System.IO.File.Exists(file.FullPath));
				(from file in this.files
				where file.Status == "INTEGRATED" && !file.Disposed
				select file).ToList<ZionRobot.Models.Items.File>().ForEach(delegate(ZionRobot.Models.Items.File file)
				{
					file.Dispose();
				});
				return this.files;
			}
		}

		// Token: 0x17000040 RID: 64
		// (get) Token: 0x060000BC RID: 188 RVA: 0x00005DC0 File Offset: 0x00003FC0
		internal List<ZionRobot.Models.Items.File> Extraction
		{
			get
			{
				bool flag = this.Files == null;
				List<ZionRobot.Models.Items.File> result;
				if (flag)
				{
					result = null;
				}
				else
				{
					this.extraction = (from x in this.Files
					where x.Status == "EXTRACTION"
					select x).ToList<ZionRobot.Models.Items.File>();
					result = this.extraction;
				}
				return result;
			}
		}

		// Token: 0x17000041 RID: 65
		// (get) Token: 0x060000BD RID: 189 RVA: 0x00005E20 File Offset: 0x00004020
		internal List<ZionRobot.Models.Items.File> Integration
		{
			get
			{
				bool flag = this.Files == null;
				List<ZionRobot.Models.Items.File> result;
				if (flag)
				{
					result = null;
				}
				else
				{
					this.exportation = (from x in this.Files
					where x.Status == "INTEGRATION"
					select x).ToList<ZionRobot.Models.Items.File>();
					result = this.exportation;
				}
				return result;
			}
		}

		// Token: 0x17000042 RID: 66
		// (get) Token: 0x060000BE RID: 190 RVA: 0x00005E80 File Offset: 0x00004080
		internal ZionRobot.Models.Items.File Integrated
		{
			get
			{
				bool flag = this.Files == null;
				ZionRobot.Models.Items.File result;
				if (flag)
				{
					result = null;
				}
				else
				{
					IEnumerable<ZionRobot.Models.Items.File> enumerable = from x in this.Files
					where x.Status == "INTEGRATED"
					select x;
					this.exportated = ((enumerable != null) ? enumerable.FirstOrDefault<ZionRobot.Models.Items.File>() : null);
					result = this.exportated;
				}
				return result;
			}
		}

		// Token: 0x04000044 RID: 68
		private List<ZionRobot.Models.Items.File> files;

		// Token: 0x04000045 RID: 69
		private List<ZionRobot.Models.Items.File> extraction;

		// Token: 0x04000046 RID: 70
		private List<ZionRobot.Models.Items.File> exportation;

		// Token: 0x04000047 RID: 71
		private ZionRobot.Models.Items.File exportated;
	}
}
