Esempio n. 1
0
 public int attack(IHeroes.IHero hero)
 {
     Random damageDealt = new Random();
     int minDamageAfterArmor = minDamage * (100 - hero.armor) / 100;
     int maxDamageAfterArmor = maxDamage * (100 - hero.armor) / 100;
     return damageDealt.Next(minDamageAfterArmor, maxDamageAfterArmor);
 }
Esempio n. 2
0
 public int charge(IHeroes.IHero hero)
 {
     Random damageDealt = new Random();
     mana -= chargeAbility.mana;
     int chargeDamageAfterArmor = chargeAbility.damage * (100 - hero.armor) / 100;
     return damageDealt.Next(chargeDamageAfterArmor - 2, chargeDamageAfterArmor + 2);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the Unknowntype class.
 /// </summary>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public Unknowntype(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)
     : base(rootHandler, handlers)
 {
     this._bookings = new Bookings(this);
     this._heroes   = new Heroes(this);
     this._skills   = new Skills(this);
     this._baseUri  = new Uri("https://dqccomics-webapi.azurewebsites.net");
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the Unknowntype class.
 /// </summary>
 public Unknowntype()
     : base()
 {
     this._bookings = new Bookings(this);
     this._heroes   = new Heroes(this);
     this._skills   = new Skills(this);
     this._baseUri  = new Uri("https://dqccomics-webapi.azurewebsites.net");
 }
Esempio n. 5
0
 /// <param name='operations'>
 /// Reference to the DqccomicsMobileapiService.IHeroes.
 /// </param>
 /// <param name='search'>
 /// Required.
 /// </param>
 public static IList <ApiHeroLimited> PostHeroes(this IHeroes operations, ApiHeroSearch search)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IHeroes)s).PostHeroesAsync(search);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 6
0
 /// <param name='operations'>
 /// Reference to the DqccomicsMobileapiService.IHeroes.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 public static ApiHeroLimited GetHero(this IHeroes operations, int id)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IHeroes)s).GetHeroAsync(id);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 public HeroesProxy(IHeroes heroesService)
 {
     this.heroesService = heroesService;
     cacheHero          = new Dictionary <string, List <Hero> >();
 }
Esempio n. 8
0
        /// <param name='operations'>
        /// Reference to the DqccomicsMobileapiService.IHeroes.
        /// </param>
        /// <param name='search'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <IList <ApiHeroLimited> > PostHeroesAsync(this IHeroes operations, ApiHeroSearch search, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <DqccomicsMobileapiService.Models.ApiHeroLimited> > result = await operations.PostHeroesWithOperationResponseAsync(search, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Esempio n. 9
0
        /// <param name='operations'>
        /// Reference to the DqccomicsMobileapiService.IHeroes.
        /// </param>
        /// <param name='id'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <ApiHeroLimited> GetHeroAsync(this IHeroes operations, int id, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <DqccomicsMobileapiService.Models.ApiHeroLimited> result = await operations.GetHeroWithOperationResponseAsync(id, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Esempio n. 10
0
 public int shieldbash(IHeroes.IHero hero)
 {
     Random damageDealt = new Random();
     mana -= shieldbashAbility.mana;
     int shieldBashDamageAfterArmor = shieldbashAbility.damage * (100 - hero.armor) / 100;
     return damageDealt.Next(shieldBashDamageAfterArmor - 2, shieldBashDamageAfterArmor + 2);
 }
 public ListHeroesViewViewModel(INavigationService navigationService, IHeroes heroes) : base(navigationService)
 {
     _navigation = navigationService;
     _heroes     = heroes;
     Title       = "Heroes";
 }