public async Task StartNewRound([QueueTrigger("start-round", Connection = "AzureWebJobsStorage")]
                                        StartNewRound startRound,
                                        ILogger log)
        {
            log.LogInformation(
                $"Processed startRound: roundId={startRound.RoundId}, gameId={startRound.GameId} position={startRound.Position}");

            await execute.Once <StartNewRound>(startRound.RoundId)
            .On <ShootingRangeState>(startRound.GameId, sr =>
            {
                sr.TargetPosition   = startRound.Position;
                sr.NumberOfAttempts = 0;
            });
        }
Пример #2
0
        public async Task StartNewRound(
            [QueueTrigger("start-round")] StartNewRound startRound,
            [ExactlyOnce(requestId: "{roundId}", stateId: "{gameId}")] IOnceExecutor <ShootingRangeState> execute,
            ILogger log)
        {
            log.LogInformation(
                $"Processed startRound: roundId={startRound.RoundId}, gameId={startRound.GameId} position={startRound.Position}");

            await execute.Once(sr =>
            {
                sr.TargetPosition   = startRound.Position;
                sr.NumberOfAttempts = 0;
            });
        }