コード例 #1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="script">Script handle to edit</param>
		/// <param name="dungeon">Dungeon handle</param>
		public AlcoveScriptForm(AlcoveScript script, Dungeon dungeon)
		{
			InitializeComponent();

			if (script == null)
				Script = new AlcoveScript();
			else
				Script = script;

			Dungeon = dungeon;
			ActionBox.Dungeon = dungeon;
			ActionBox.Script = Script;
		}
コード例 #2
0
ファイル: Alcove.cs プロジェクト: melkor54248/dungeoneye
		/// <summary>
		/// 
		/// </summary>
		/// <param name="xml"></param>
		/// <returns></returns>
		public bool Load(XmlNode xml)
		{
			if (xml == null)
				return false;

			Decoration = int.Parse(xml.Attributes["deco"].Value);
			HideItems = bool.Parse(xml.Attributes["hide"].Value);
			AcceptBigItems = bool.Parse(xml.Attributes["bigitems"].Value);
			//ItemLocation = new Point(int.Parse(xml.Attributes["x"].Value), 
			//                         int.Parse(xml.Attributes["y"].Value));

			foreach (XmlNode node in xml)
			{
				switch (node.Name.ToLower())
				{
					case "onaddeditem":
					{
						foreach (XmlNode sub in node)
						{
							AlcoveScript script = new AlcoveScript();
							script.Load(sub);

							OnAddedItem.Add(script);
						}
					}
					break;

					case "onremoveditem":
					{
						foreach (XmlNode sub in node)
						{
							AlcoveScript script = new AlcoveScript();
							script.Load(sub);

							OnRemovedItem.Add(script);
						}
					}
					break;

					default:
					{
					}
					break;
				}
			}


			return true;
		}