Ejemplo n.º 1
0
        public async Task <IActionResult> ModifyBuildingUpgradeCost([FromBody] UpgradeCostCreationRequest request)
        {
            await _mediator.Send(new ModifyBuildingUpgradeCost.Command(request));

            return(NoContent());
        }
Ejemplo n.º 2
0
 public static BuildingUpgradeCost ModifyValues(this BuildingUpgradeCost previousCost, UpgradeCostCreationRequest newCost)
 {
     previousCost.UpgradeCost.Wood       = newCost.UpgradeCost.Wood;
     previousCost.UpgradeCost.Silver     = newCost.UpgradeCost.Silver;
     previousCost.UpgradeCost.Stone      = newCost.UpgradeCost.Stone;
     previousCost.UpgradeCost.Population = newCost.UpgradeCost.Population;
     // previousCost.UpgradeTime = TimeSpan.FromSeconds(newCost.UpgradeTimeInSeconds);
     return(previousCost);
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> CreateBuildingUpgradeCost([FromBody] UpgradeCostCreationRequest request)
        {
            await _mediator.Send(new CreateBuildingUpgradeCost.Command(request));

            return(StatusCode(205));
        }
Ejemplo n.º 4
0
 public record Command(UpgradeCostCreationRequest Request) : IRequest <Unit>;