using System;
using System.Collections.Generic;
using System.Xml;

namespace ZionRobot.Models.Source
{
	// Token: 0x0200002B RID: 43
	public class BlockElement
	{
		// Token: 0x17000072 RID: 114
		// (get) Token: 0x0600012D RID: 301 RVA: 0x00007B8A File Offset: 0x00005D8A
		// (set) Token: 0x0600012E RID: 302 RVA: 0x00007B92 File Offset: 0x00005D92
		public string Name { get; set; }

		// Token: 0x17000073 RID: 115
		// (get) Token: 0x0600012F RID: 303 RVA: 0x00007B9B File Offset: 0x00005D9B
		// (set) Token: 0x06000130 RID: 304 RVA: 0x00007BA3 File Offset: 0x00005DA3
		public List<Action> Actions { get; set; }

		// Token: 0x06000131 RID: 305 RVA: 0x00007BAC File Offset: 0x00005DAC
		public BlockElement(XmlElement node)
		{
			this.Name = node.GetAttribute("Name");
			this.Actions = new List<Action>();
			foreach (object obj in node.SelectNodes("Action"))
			{
				XmlElement action = (XmlElement)obj;
				this.Actions.Add(new Action(action));
			}
		}

		// Token: 0x06000132 RID: 306 RVA: 0x00007C4C File Offset: 0x00005E4C
		public XmlElement AppendTo(XmlDocument doc)
		{
			XmlElement root = doc.CreateElement(this.mainTag);
			root.SetAttribute("Name", this.Name);
			this.Actions.ForEach(delegate(Action action)
			{
				root.AppendChild(action.AppendTo(doc));
			});
			return root;
		}

		// Token: 0x0400006C RID: 108
		private string mainTag = "Block";
	}
}
