Ejemplo n.º 1
0
        public Task MoveAnimalAsync(string gameName, string animalName, string enclosureName)
        {
            var command = new MoveAnimalCommand
            {
                AnimalName    = animalName,
                EnclosureName = enclosureName
            };

            return(_client.SendJsonAsync(HttpMethod.Post, $"/api/game/{gameName}/move-animal", command));
        }
Ejemplo n.º 2
0
        public static Task MoveAnimal(
            [HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "game/{gameName}/move-animal")] MoveAnimalCommand command,
            [DurableClient] IDurableEntityClient client,
            string gameName)
        {
            var movement = new AnimalMovement
            {
                AnimalName       = command.AnimalName,
                NewEnclosureName = command.EnclosureName
            };

            var entityId = new EntityId(nameof(GameSession), gameName);

            return(client.SignalEntityAsync <IGameSession>(entityId, proxy => proxy.MoveAnimalAsync(movement)));
        }