コード例 #1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="script"></param>
		public DisableChoiceControl(DisableChoice script)
		{
			InitializeComponent();

			if (script != null)
				Action = script;
			else
				Action = new DisableChoice();
		}
コード例 #2
0
		/// <summary>
		/// Loads actions
		/// </summary>
		/// <param name="filename">Xml node</param>
		public void LoadActions(XmlNode xml)
		{
			if (xml == null || xml.Name.ToLower() != "actions")
				return;

			foreach (XmlNode node in xml)
			{
				if (node.NodeType == XmlNodeType.Comment)
					continue;


				switch (node.Name.ToLower())
				{
					case "teleport":
					{
						Teleport teleport = new Teleport();
						teleport.Load(node);
						Actions.Add(teleport);
					}
					break;

					case "giveexperience":
					{
						GiveExperience script = new GiveExperience();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "activate":
					{
						ActivateTarget script = new ActivateTarget();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "changepicture":
					{
						ChangePicture script = new ChangePicture();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "changetext":
					{
						ChangeText script = new ChangeText();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "deactivate":
					{
						DeactivateTarget script = new DeactivateTarget();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "disablechoice":
					{
						DisableChoice script = new DisableChoice();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "disable":
					{
						DisableTarget script = new DisableTarget();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "enablechoice":
					{
						EnableChoice script = new EnableChoice();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "endchoice":
					{
						EndChoice script = new EndChoice();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "enddialog":
					{
						EndDialog script = new EndDialog();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "giveitem":
					{
						GiveItem script = new GiveItem();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "healing":
					{
						Healing script = new Healing();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "joincharacter":
					{
						JoinCharacter script = new JoinCharacter();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "playsound":
					{
						PlaySound script = new PlaySound();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					case "toggle":
					{
						ToggleTarget script = new ToggleTarget();
						script.Load(node);
						Actions.Add(script);
					}
					break;

					default:
					{
						Trace.WriteLine("[ScriptChoice] LoadActions() : Unknown node \"{0}\"", node.Name);
					}
					break;
				}
			}

		}
コード例 #3
0
ファイル: ScriptBase.cs プロジェクト: melkor54248/dungeoneye
		/// <summary>
		/// Loads a party
		/// </summary>
		/// <param name="filename">Xml data</param>
		/// <returns>True if team successfuly loaded, otherwise false</returns>
		public virtual bool Load(XmlNode xml)
		{
			if (xml == null)
				return false;


			Action = null;

			switch (xml.Name)
			{
				case SpawnMonster.Tag:
				{
					Action = new SpawnMonster();
				}
				break;

				case EnableTarget.Tag:
				{
					Action = new EnableTarget();
				}
				break;

				case DisableTarget.Tag:
				{
					Action = new DisableTarget();
				}
				break;

				case ActivateTarget.Tag:
				{
					Action = new ActivateTarget();
				}
				break;

				case DeactivateTarget.Tag:
				{
					Action = new DeactivateTarget();
				}
				break;

				case ChangePicture.Tag:
				{
					Action = new ChangePicture();
				}
				break;

				case ChangeText.Tag:
				{
					Action = new ChangeText();
				}
				break;

				case DisableChoice.Tag:
				{
					Action = new DisableChoice();
				}
				break;

				case EnableChoice.Tag:
				{
					Action = new EnableChoice();
				}
				break;

				case EndChoice.Tag:
				{
					Action = new EndChoice();
				}
				break;

				case EndDialog.Tag:
				{
					Action = new EndDialog();
				}
				break;

				case GiveExperience.Tag:
				{
					Action = new GiveExperience();
				}
				break;

				case GiveItem.Tag:
				{
					Action = new GiveItem();
				}
				break;

				case Healing.Tag:
				{
					Action = new Healing();
				}
				break;

				case JoinCharacter.Tag:
				{
					Action = new JoinCharacter();
				}
				break;

				case PlaySound.Tag:
				{
					Action = new PlaySound();
				}
				break;

				case SetTo.Tag:
				{
					Action = new SetTo();
				}
				break;

				case Teleport.Tag:
				{
					Action = new Teleport();
				}
				break;

				case ToggleTarget.Tag:
				{
					Action = new ToggleTarget();
				}
				break;

				case DisplayMessage.Tag:
				{
					Action = new DisplayMessage();
				}
				break;

				default:
				{
					Trace.WriteLine("[ScriptBase] Load() : Unknown node \"" + xml.Name + "\" found.");
					return false;
				}
			}

			if (Action == null)
				return false;


			Action.Load(xml);

			return true;
		}