Exemplo n.º 1
0
        public async Task <IHttpActionResult> ChangeTroopType(string id, ChangeTroopTypeModel model)
        {
            await _gameService.ChangeTroopType(new ChangeTroopTypeDto
            {
                Id        = id,
                CastleId  = model.CastleId,
                TroopType = model.Type
            });

            return(Ok(true));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Change troop type of castle
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='model'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> ChangeTroopTypeAsync(this IGame operations, string id, ChangeTroopTypeModel model, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ChangeTroopTypeWithHttpMessagesAsync(id, model, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Change troop type of castle
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='model'>
 /// </param>
 public static object ChangeTroopType(this IGame operations, string id, ChangeTroopTypeModel model)
 {
     return(operations.ChangeTroopTypeAsync(id, model).GetAwaiter().GetResult());
 }