Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="script"></param>
        /// <param name="dungeon">Dungeon handle</param>
        public EnableTargetControl(EnableTarget script, Dungeon dungeon)
        {
            InitializeComponent();

            if (script != null)
            {
                Action = script;
            }
            else
            {
                Action = new EnableTarget();
            }

            TargetBox.SetTarget(dungeon, Action.Target);
        }
Exemplo n.º 2
0
        public async Task SeedAsync(CancellationToken cancellationToken)
        {
            if (!_environmentVariables.Variables.ContainsKey("TestDeploymentTargetPath"))
            {
                return;
            }

            var testTarget = new DeploymentTarget(
                new DeploymentTargetId("TestTarget"),
                "Test target",
                "MilouDeployerWebTest",
                allowExplicitPreRelease: false,
                autoDeployEnabled: true,
                targetDirectory: _environmentVariables.Variables["TestDeploymentTargetPath"],
                url: _environmentVariables.Variables["TestDeploymentUri"].ParseUriOrDefault(),
                emailNotificationAddresses: new StringValues("*****@*****.**"),
                enabled: true);

            var createTarget = new CreateTarget(testTarget.Id.TargetId, testTarget.Name);
            await _mediator.Send(createTarget, cancellationToken);

            string nugetConfigFile = _keyValueConfiguration[ConfigurationConstants.NugetConfigFile];

            var updateDeploymentTarget = new UpdateDeploymentTarget(
                testTarget.Id,
                testTarget.AllowPreRelease,
                testTarget.Url?.ToString(),
                testTarget.PackageId,
                autoDeployEnabled: testTarget.AutoDeployEnabled,
                targetDirectory: testTarget.TargetDirectory,
                nugetConfigFile: nugetConfigFile);

            await _mediator.Send(updateDeploymentTarget, cancellationToken);

            var enableTarget = new EnableTarget(testTarget.Id.TargetId);

            await _mediator.Send(enableTarget, cancellationToken);
        }
Exemplo n.º 3
0
        /// <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);
        }