Ejemplo n.º 1
0
        public async Task <ActionResult <Casts> > PostCasts(Casts casts)
        {
            _context.Casts.Add(casts);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCasts", new { id = casts.ID }, casts));
        }
Ejemplo n.º 2
0
        internal DataType GetCastTypeByName(string typeTokenName)
        {
            var casts  = Casts.Where(ci => ci.Token == typeTokenName);
            var castTo = casts.Select(ci => ci.ToType).FirstOrDefault();

            return(castTo);
        }
Ejemplo n.º 3
0
 private static void Clear()
 {
     if (GetBool("main.clear.q") && ManalimiterCheck("main.clear.qm"))
     {
         Casts.QMinion();
     }
 }
Ejemplo n.º 4
0
        private async Task GetMovieDetails(int movieId)
        {
            if (!IsDataLoaded)
            {
                try
                {
                    IsBusy        = true;
                    SelectedMovie = await _apiService.GetMovieDetails(movieId);

                    Casts = await _apiService.GetCastForMovie(movieId);

                    MovieImage = await _apiService.GetMovieImages(movieId);

                    TopCasts = Casts.GetRange(0, 4);
                    Videos   = await _apiService.GetMovieVideos(movieId);

                    IsDataLoaded = true;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Execption movie details", ex);
                    await _pageService.DisplayAlert("Error", "Failed to load movie details", "OK", "Cancel");
                }
                finally
                {
                    IsBusy = false;
                }
            }
        }
        //Loading the view along with the data to be displayed
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            int id = 0;

            if (parameter != null)
            {
                id = (int)parameter;
            }
            var service = new MovieService();

            Movie = await service.GetMovieAsync(id);

            var credits = await service.GetMovieCastAndCrewAsync(id);

            foreach (Cast c in credits.cast)
            {
                Casts.Add(c);
            }

            foreach (Crew c in credits.crew)
            {
                Crews.Add(c);
            }

            await base.OnNavigatedToAsync(parameter, mode, state);
        }
        //Loading the view along with the data to be displayed
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            int id = 0;

            if (parameter != null)
            {
                id = (int)parameter;
            }
            var service = new MovieService();

            Series = await service.GetSeriesAsync(id);

            var credits = await service.GetSeriesCastAndCrewAsync(id);

            foreach (Cast c in credits.cast)
            {
                Casts.Add(c);
            }

            foreach (Crew c in credits.crew)
            {
                Crews.Add(c);
            }

            for (int i = 0; i < Series.number_of_seasons; i++)
            {
                var season = await service.GetSeasonEpisodesAsync(id, i);

                Seasons.Add(season);
            }

            await base.OnNavigatedToAsync(parameter, mode, state);
        }
Ejemplo n.º 7
0
 private static void Harass()
 {
     if (GetBool("main.harass.q") && ManalimiterCheck("main.harass.qm"))
     {
         Casts.Q();
     }
 }
Ejemplo n.º 8
0
        /// <summary>Gets the cast needed for casting to the database type.</summary>
        /// <exception cref="InvalidCastException">
        /// If the required cast is not defined.
        /// </exception>
        private static MethodInfo GetCast(Type sourceType, SingleValueObjectAttribute attr)
        {
            if (!Casts.TryGetValue(sourceType, out MethodInfo cast))
            {
                var returnType = attr.DatabaseType ?? attr.UnderlyingType;
                var methods    = sourceType.GetMethods(BindingFlags.Public | BindingFlags.Static)
                                 .Where(m =>
                                        m.IsHideBySig &&
                                        m.IsSpecialName &&
                                        m.GetParameters().Length == 1 &&
                                        m.ReturnType == returnType)
                                 .ToList();

                if (methods.Any())
                {
                    cast = methods[0];
                    Casts[sourceType] = cast;
                }
                else
                {
                    throw new InvalidCastException(string.Format(QowaivMessages.InvalidCastException_FromTo, sourceType, returnType));
                }
            }
            return(cast);
        }
Ejemplo n.º 9
0
        public BattleUnitsStack(BattleUnitsStack otherStack)
        {
            unitsType      = otherStack.unitsType;
            totalHitPoints = otherStack.totalHitPoints;
            state          = otherStack.state;
            fightedBack    = otherStack.fightedBack;
            initHitPoints  = otherStack.initHitPoints;
            _metaUnit      = new BattleUnit(otherStack.metaUnit);

            foreach (IModifier mod in otherStack.Modifiers.Keys)
            {
                Modifiers.Add(mod, (double)otherStack.Modifiers[mod]);
            }
            foreach (BaseEffect effect in otherStack.Effects.Keys)
            {
                AddEffect(effect, double.PositiveInfinity);
            }
            GetLastEffect()?.Init();

            foreach (var cast in otherStack.Casts)
            {
                Casts.Add(cast);
            }
            parentArmy = otherStack.parentArmy;
        }
Ejemplo n.º 10
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,SeriesID,ActorID,CharacterID,FirstAppereance,LastAppereance")] Casts casts)
        {
            if (id != casts.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(casts);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CastsExists(casts.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActorID"]     = new SelectList(_context.Actors, "ID", "ID", casts.ActorID);
            ViewData["CharacterID"] = new SelectList(_context.Characters, "ID", "ID", casts.CharacterID);
            return(View(casts));
        }
Ejemplo n.º 11
0
        public BattleUnitsStack(Unit _unitsType, uint _unitsCount)
        {
            unitsType = _unitsType;
            if (_unitsCount > MAXSIZE)
            {
                throw new UnitsStackOverflowException($"Trying to make battle stack of \"{unitsType.type}\" with {_unitsCount} units.\nBattleUnitsStack.MAXSIZE = {MAXSIZE}");
            }
            totalHitPoints = unitsType.hitPoints * _unitsCount;
            state          = State.NotMadeMove;
            fightedBack    = false;
            initHitPoints  = totalHitPoints;
            _metaUnit      = new BattleUnit(_unitsType);

            foreach (var effect in _unitsType.Effects)
            {
                AddEffect(effect, double.PositiveInfinity);
            }
            GetLastEffect()?.Init();
            foreach (var cast in _unitsType.Casts)
            {
                Casts.Add(cast);
            }

            parentArmy = null;
        }
Ejemplo n.º 12
0
        public async Task <IActionResult> PutCasts(int id, Casts casts)
        {
            if (id != casts.ID)
            {
                return(BadRequest());
            }

            _context.Entry(casts).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CastsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 13
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }
            prediction = config.Item("main.settings.pred").GetValue <StringList>().SelectedValue;
            if (GetBool("main.settings.w.enabled") && !Player.IsRecalling())
            {
                Casts.W();
            }
            if (GetBool("main.settings.ignite"))
            {
                Casts.Ignite();
            }

            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.LastHit:
            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;
            }
        }
Ejemplo n.º 14
0
        public IActionResult Delete(Casts cast)
        {
            var result = _castService.Delete(cast);

            if (result.Success)
            {
                return(Ok(result.Message));
            }
            return(BadRequest(result.Message));
        }
Ejemplo n.º 15
0
 private static void Lasthit() //by Maddo
 {
     if (GetBool("main.lasthit.q") && ManalimiterCheck("main.lasthit.qm"))
     {
         Obj_AI_Minion targetMinion = MinionManager.GetMinions(q.Range).FirstOrDefault() as Obj_AI_Minion;
         if (targetMinion != null)
         {
             Casts.QMinion(targetMinion);
         }
     }
 }
Ejemplo n.º 16
0
        private static void Harass()
        {
            if (GetBool("main.harass.q"))
            {
                Casts.Q();
            }

            if (GetBool("main.harass.e"))
            {
                Casts.E();
            }
        }
Ejemplo n.º 17
0
        private static void Clear()
        {
            //fix
            if (GetBool("main.clear.q"))
            {
                Casts.QMinion();
            }

            if (GetBool("main.clear.e"))
            {
                Casts.EMinion();
            }
        }
Ejemplo n.º 18
0
        public async Task <IActionResult> Create([Bind("ID,SeriesID,ActorID,CharacterID,FirstAppereance,LastAppereance")] Casts casts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(casts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActorID"]     = new SelectList(_context.Actors, "ID", "ID", casts.ActorID);
            ViewData["CharacterID"] = new SelectList(_context.Characters, "ID", "ID", casts.CharacterID);
            return(View(casts));
        }
Ejemplo n.º 19
0
 public IEnumerable <TVShow> GetTVShows()
 {
     return
         (from tvShow in _context.TVShows
          join cast in _context.Casts.DefaultIfEmpty() on tvShow.ID equals cast.TVShowId
          into Casts
          select new TVShow()
     {
         ID = tvShow.ID,
         Name = tvShow.Name,
         Cast = Casts.ToList()
     });
 }
Ejemplo n.º 20
0
        private static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
        {
            if (!sender.IsEnemy || !config.Item("main.settings.w").GetValue <bool>() || sender.Type != GameObjectType.obj_AI_Hero)
            {
                return;
            }
            Obj_AI_Hero tar = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(args.TargetNetworkId);

            if (((tar.Health - args.Damage) / tar.Health) > config.Item("main.settings.whp").GetValue <Slider>().Value)
            {
                Casts.W();
            }
        }
Ejemplo n.º 21
0
 public UserCast(Casts casts, string aName, string aPhoto, string cName, string cPhoto)
 {
     ID              = casts.ID;
     ActorID         = casts.ActorID;
     CharacterID     = casts.CharacterID;
     FirstAppereance = casts.FirstAppereance;
     LastAppereance  = casts.LastAppereance;
     Actor           = casts.Actor;
     Character       = casts.Character;
     ActorName       = aName;
     ActorPhoto      = aPhoto;
     CharacterName   = cName;
     CharacterPhoto  = cPhoto;
 }
Ejemplo n.º 22
0
        private static void Combo()
        {
            if (GetBool("main.combo.q"))
            {
                Casts.Q();
            }

            if (GetBool("main.combo.e"))
            {
                Casts.E();
            }

            if (GetBool("main.combo.r"))
            {
                Casts.R();
            }
        }
Ejemplo n.º 23
0
        public async Task <IActionResult> Create([Bind("ID,SeriesID,ActorID,CharacterID,FirstAppereance,LastAppereance")] Casts casts)
        {
            var character = _context.Characters.Where(c => c.ID == casts.CharacterID).FirstOrDefault();

            if (ModelState.IsValid)
            {
                _context.Add(casts);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index", "Casts", new { seriesID = character.SeriesID }));
                //return RedirectToAction(nameof(Index));
            }
            ViewData["ActorID"]     = new SelectList(_context.Actors, "ID", "ID", casts.ActorID);
            ViewData["CharacterID"] = new SelectList(_context.Characters.Where(c => c.SeriesID == character.SeriesID), "ID", "ID", casts.CharacterID);
            return(RedirectToAction("Index", "Casts", new { seriesID = character.SeriesID }));
            //return View(casts);
        }
Ejemplo n.º 24
0
        private static void Clear()
        {
            if (GetBool("main.clear.barrel"))
            {
                if (Math.ClosestBarrel(Player.GetEnemiesInRange(SightRange).First().ServerPosition.To2D()) != null)
                {
                    Casts.AttackBarrel();
                }
            }

            if (GetBool("main.clear.q") && ManalimiterCheck("main.clear.qm"))
            {
                Obj_AI_Minion targetMinion = MinionManager.GetMinions(q.Range).FirstOrDefault() as Obj_AI_Minion;
                if (targetMinion != null)
                {
                    Casts.QMinion(targetMinion);
                }
            }
        }
Ejemplo n.º 25
0
        /*
         * OnDash
         */

        private static void OnDash(Obj_AI_Base sender, Dash.DashEventArgs args)
        {
            var target = TargetSelector.GetTarget(R.Range, DamageType.Physical); // 1500?

            if (target == null || !target.IsValidTarget())
            {
                return;
            }
            if (sender.IsMe && onCombo)
            {
                var cType = Misc.getSliderValue(ComboMenu, "cPrio");
                if (Ferocity == 5)
                {
                    if (cType == 1 && _Player.IsDashing())
                    {
                        Casts.useQ(target);
                    }
                    if (cType == 0 && _Player.IsDashing())
                    {
                        Casts.useE(target);
                    }
                }
                if (Ferocity < 5)
                {
                    if (E.IsReady() && _Player.IsDashing())
                    {
                        Casts.useE(target);
                        Player.IssueOrder(GameObjectOrder.AttackUnit, target);
                    }
                    if (Q.IsReady() && _Player.IsDashing())
                    {
                        Casts.useQ(target);
                        Player.IssueOrder(GameObjectOrder.AttackUnit, target);
                    }
                    if (W.IsReady() && _Player.IsDashing())
                    {
                        Casts.useW(target);
                        Player.IssueOrder(GameObjectOrder.AttackUnit, target);
                        Items.useHydra(target);
                    }
                }
            }
        }
Ejemplo n.º 26
0
        public BattleUnitsStack(UnitsStack otherStack)
        {
            unitsType      = otherStack.unitsType;
            totalHitPoints = otherStack.unitsCount * unitsType.hitPoints;
            state          = State.NotMadeMove;
            fightedBack    = false;
            initHitPoints  = totalHitPoints;
            _metaUnit      = new BattleUnit(otherStack.unitsType);

            foreach (BaseEffect effect in otherStack.unitsType.Effects)
            {
                AddEffect(effect, double.PositiveInfinity);
            }
            GetLastEffect()?.Init();
            foreach (var cast in otherStack.unitsType.Casts)
            {
                Casts.Add(cast);
            }
            parentArmy = null;
        }
Ejemplo n.º 27
0
        private static void Harass() //or mixed :^)
        {
            if (GetBool("main.harass.q") && ManalimiterCheck("main.harass.qm"))
            {
                Obj_AI_Hero target = TargetSelector.GetTarget(q.Range, q.DamageType);
                if (target != null)
                {
                    Casts.QHero(target);
                }

                if (GetBool("main.lassthit.q") && ManalimiterCheck("main.lassthit.qm"))
                {
                    Obj_AI_Minion targetMinion = MinionManager.GetMinions(q.Range).FirstOrDefault() as Obj_AI_Minion;
                    if (targetMinion != null)
                    {
                        Casts.QMinion(targetMinion);
                    }
                }
            }
        }
Ejemplo n.º 28
0
        public void RequestDetails()
        {
            var databaseService = ServiceLocator.Current.GetInstance <DatabaseService>();

            using (var connection = databaseService.Connect())
            {
                Slot = connection.Slots.Single(w => w.SlotId == _model.SlotId);
                var firstEpisode = Slot.Episodes.First();
                firstEpisode.Casts.ToList().ForEach(w => Casts.Add(w.Name));
                firstEpisode.Crews.ToList().ForEach(w => Crews.Add(w.Name));
                ProgramId = firstEpisode.EpisodeId;
                Channel   = Slot.Channel;
                Series    = firstEpisode.Series;
                if (CanSlotReservation)
                {
                    CanSlotReservation = !connection.SlotReservations.Any(w => w.Slot.SlotId == _model.SlotId);
                }
                CanSeriesReservation = !connection.SeriesReservations.Any(w => w.Series.SeriesId == Series.SeriesId);
            }
        }
Ejemplo n.º 29
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Player.HasBuff("GarenE"))
            {
                Orbwalking.MoveTo(Game.CursorPos);
            }

            if (GetBool("main.settings.ignite"))
            {
                Casts.Ignite();
            }
            if (GetBool("main.settings.ks"))
            {
                Casts.R();
            }

            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;
            }

            if (config.Item("main.settings.flee").GetValue <KeyBind>().Active)
            {
                Orbwalking.MoveTo(Game.CursorPos);
                if (q.IsReady())
                {
                    q.Cast();
                }
            }
        }
Ejemplo n.º 30
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }
            if (GetBool("main.settings.r"))
            {
                Casts.R();
            }
            if (GetBool("main.settings.ignite"))
            {
                Casts.Ignite();
            }
            if (ManalimiterCheck("main.settings.w.wm") && GetBool("main.settings.w.enabled"))
            {
                Casts.W();
            }
            targetedBarrelQ = null;
            targetedBarrelQ = Math.ClosestBarrelWherePosInExplosionRange(Player.ServerPosition.To2D());
            if (GetBool("main.settings.aqe"))
            {
                Casts.AQE();
            }

            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
            case Orbwalking.OrbwalkingMode.LastHit:
                Clear();
                break;
            }
        }