/// <summary> /// Create instance of <see cref="GetChallengeLinkResponse" /> with required parameters /// </summary> /// <param name="context">Value for <see cref="Context" />. Context identifier</param> /// <param name="url">Value for <see cref="Url" />. Url for qr or link that leads to OwnId app</param> /// <param name="nonce">Value for <see cref="Nonce" /></param> /// <param name="expiration">Context expiration</param> /// <param name="magicLinkEnabled">Magic link feature flag</param> public GetChallengeLinkResponse(string context, string url, string nonce, uint expiration, bool magicLinkEnabled) { Context = context; Url = url; Nonce = nonce; Expiration = expiration; Config = new ChallengeConfig { MagicLinkEnabled = magicLinkEnabled }; }
public AnswersController( ChallengeConfig challengeConfig, ProductSortService productSortService, HelperResourceService helperResourceService, TrolleyTotalService trolleyTotalService, ILogger <AnswersController> logger) : base() { _challengeConfig = challengeConfig; _productSortService = productSortService; _helperResourceService = helperResourceService; _trolleyTotalService = trolleyTotalService; _logger = logger; }
private void CreateWaves(StageConfig stageConfig, DefaultStage stage, DungeonLogic dungeonLogic) { List <WaveConfig> waves = stageConfig.WaveList(); for (int waveIndex = 0; waveIndex < waves.Count; waveIndex++) { WaveConfig w = waves[waveIndex]; if (w.IsDisabled()) { continue; } DefaultWaveLogic waveLogic = new DefaultWaveLogic(waveIndex + 1); List <ChallengeConfig> challengeConfigs = w.ChallengeList(); for (int challengeIndex = 0; challengeIndex < challengeConfigs.Count; challengeIndex++) { ChallengeConfig challengeConfig = challengeConfigs[challengeIndex]; if (challengeConfig.IsDisabled()) { continue; } ActionsByLayer actionsByLayer = CreateActionsByLayer(challengeConfig.SpawnConfig().ActionConfigs(), dungeonLogic); Challenge challenge = CreateChallenge(challengeConfig, actionsByLayer.allActions, dungeonLogic); // challenge.Name = (waveIndex + 1) + "-" + (challengeIndex + 1); waveLogic.AddChallenge(challenge); foreach (IAction stageAction in actionsByLayer.stageActions) { stage.AddAction(stageAction); } foreach (IAction dungeonAction in actionsByLayer.dungeonActions) { dungeonLogic.AddAction(dungeonAction); } } stage.AddWave(waveLogic); } }
private Challenge CreateChallenge(ChallengeConfig challengeConfig, List <IAction> actions, DungeonLogic dungeonLogic) { Trigger startTrigger = CreateTrigger(challengeConfig.StartTrigger()); SpawnOverTime sot = CreateSpawnOverTime(challengeConfig.SpawnConfig()); List <TrackerConfig> trackerConfigs = challengeConfig.SpawnConfig().TrackerConfigs(); foreach (TrackerConfig trackerConfig in trackerConfigs) { if (!trackerConfig.IsActive()) { continue; } Tracker tracker = CreateTracker(trackerConfig); sot.AddTracker(tracker); } // List<ActionConfig> actionConfigs = challengeConfig.SpawnConfig().ActionConfigs(); // foreach (ActionConfig actionConfig in actionConfigs) // { // if (actionConfig.IsDisabled()) continue; // // IAction action = CreateAction(actionConfig, dungeonLogic); // sot.AddAction(action); // } foreach (IAction action in actions) { sot.AddAction(action); } DefaultChallenge challenge = new DefaultChallenge(startTrigger, sot); return(challenge); }
public HelperResourceService(IHttpClientFactory httpClientFactory, ChallengeConfig challengeConfig) { _httpClientFactory = httpClientFactory; _challengeConfig = challengeConfig; }