Ejemplo n.º 1
0
 public static void SetBFX_EQ(int channel)
 {
     //if the EQ is already made then exit
     if (MadeEq)
     {
         if (eql != null)
         {
             eql.SetBypass(!Settings.Default.afx | !Settings.Default.Equalizer);
             for (int i = 0; i < FxHolder.EqValues.Count; i++)
             {
                 UpdateFX(i, FxHolder.EqValues[i]);
             }
         }
         return;
     }
     if (Player.Instance.Wave != null)
     {
         eql = new EQ(Player.Instance.Wave.Handle, -1, OctavesSpacing);
         eql.SetBypass(!Settings.Default.afx | !Settings.Default.Equalizer);
         for (int i = 0; i < FxHolder.EqValues.Count; i++)
         {
             UpdateFX(i, FxHolder.EqValues[i]);
         }
     }
     //Now that the EQ is made
     MadeEq = true;
 }
Ejemplo n.º 2
0
        private static void HarassLogic()
        {
            var  targetQ    = Q.GetTarget();
            var  targetE    = E.GetTarget();
            var  inputQ     = Q.GetPrediction(targetQ);
            var  targetEQ   = EQ.GetTarget();
            var  inputEQ    = EQ.GetPrediction(targetEQ);
            var  targerR    = R.GetTarget();
            var  predR      = R.GetPrediction(targerR);
            bool fullstackQ = GameObjects.Player.GetBuffCount("GwenQ") == 4;

            if (mainMenu["Harass"].GetValue <MenuSlider>("mana%").Value <= GameObjects.Player.ManaPercent)
            {
                if (mainMenu["Harass"].GetValue <MenuBool>("EQuse").Enabled&& targetEQ.IsValidTarget() && inputEQ.Hitchance >= HitChance.High && E.IsReady() && Q.IsReady() && !Q.IsInRange(targetEQ))
                {
                    if ((mainMenu["Harass"].GetValue <MenuBool>("EQfull").Enabled&& fullstackQ) || !mainMenu["Combo"].GetValue <MenuBool>("EQfull").Enabled)
                    {
                        E.Cast(inputEQ.CastPosition);
                        EQ.Cast(inputEQ.CastPosition);
                    }
                }
                if (mainMenu["Harass"].GetValue <MenuBool>("Quse").Enabled&& targetQ.IsValidTarget() && inputQ.Hitchance >= HitChance.High)
                {
                    if ((mainMenu["Harass"].GetValue <MenuBool>("Qfull").Enabled&& fullstackQ) || !mainMenu["Combo"].GetValue <MenuBool>("Qfull").Enabled)
                    {
                        Q.Cast(inputQ.CastPosition);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public static void Execute()
        {
            var Champ = EntityManager.Heroes.Enemies.Where(x => x.Health < HandleDamageIndicator(x));

            if (MenuValue.Harass.UseQ && Q.IsReady())
            {
                var Target = Q.GetTarget(Champ, TargetSeclect.SpellTarget);
                if (Target != null)
                {
                    var pred = Q.GetPrediction(Target);
                    if (pred.CanNext(Q, MenuValue.General.QHitChance, true))
                    {
                        Q.Cast(pred.CastPosition);
                    }
                }
            }
            if (MenuValue.Harass.UseW && W.IsReady())
            {
                var Target = W.GetTarget(Champ, TargetSeclect.SpellTarget);
                if (Target != null)
                {
                    TakeShit_and_Cast(Target);
                }
            }
            if (MenuValue.Harass.UseE && E.IsReady())
            {
                var Target = EQ.GetTarget(Champ, TargetSeclect.SpellTarget);
                if (Target != null)
                {
                    CastE(Target, false, false);
                }
            }
        }
Ejemplo n.º 4
0
    // Update is called once per frame
    public void setLine(int i)
    {
        switch (i)
        {
        case 0: {
            readyAni.SetTrigger("on");
            Qs.SetActive(true);
            Enter.SetActive(true);
            EQ.SetActive(true);
            on[8] = false;
        } break;

        case 1: {
            readyAni.SetTrigger("on");
            As.SetActive(true);
            Enter.SetActive(true);
            EA.SetActive(true);
            on[8] = false;
        } break;

        case 2: {
            readyAni.SetTrigger("on");
            Zs.SetActive(true);
            Enter.SetActive(true);
            EZ.SetActive(true);
            on[8] = false;
        } break;
        }
    }
Ejemplo n.º 5
0
        public List <EQ> getguicheng()
        {
            List <EQ> c = new List <EQ>();

            try
            {
                using (var db = base.NewDB())
                {
                    List <File_Info> p = db.Files.Where(a => a.Self_Catalog.Catalog_Id == 28).ToList();//跨表查询Self_Catalog.Catalog_Id
                    for (int i = 0; i < p.Count; i++)
                    {
                        for (int k = 0; k < p[i].File_Equips.Count; k++)//存在文件对应的设备才进入,File_Equips.Count只可能等于一
                        {
                            Equip_Info[] zz = new Equip_Info[1];
                            p[i].File_Equips.CopyTo(zz, 0);
                            EQ temp = new EQ();

                            temp.sbGyCode  = zz[0].Equip_GyCode;
                            temp.sbCode    = zz[0].Equip_Code;
                            temp.sbType    = zz[0].Equip_Type;
                            temp.GCnewname = p[i].File_NewName;
                            temp.GColdname = p[i].File_OldName;

                            c.Add(temp);
                        }
                    }

                    return(c);
                }
            }
            catch
            {
                return(c);
            }
        }
Ejemplo n.º 6
0
        static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (Player.IsDead) // 바람장막
            {
                return;
            }

            if (!sender.IsMe)
            {
                SharpDX.Vector2 castVec = Player.ServerPosition.To2D() +
                                          SharpDX.Vector2.Normalize(args.Start.To2D() - Player.Position.To2D()) * (100f);
                if (IsSkill(args.SData.Name) && (args.Target.IsMe || !sender.IsAlly) && W.IsReady() &&
                    Player.Distance(args.End) < 250 && AIO_Menu.Champion.Misc.getBoolValue("AutoW"))
                {
                    W.Cast(castVec);
                }
            }
            else
            {
                if ((Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && AIO_Menu.Champion.Combo.UseQ || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed && AIO_Menu.Champion.Harass.UseQ))
                {
                    if (args.SData.Name == Player.Spellbook.GetSpell(SpellSlot.E).Name&& HeroManager.Enemies.Any(x => x.IsValidTarget(EQ.Range)))
                    {
                        EQ.Cast();
                    }
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// E技能鑄造
        /// </summary>
        /// <param name="useE"></param>
        private static void ECast(bool useE)
        {
            var Wtarget = TargetSelector.GetSelectedTarget()
                          ?? TargetSelector.GetTarget(W.Range + W.Width, TargetSelector.DamageType.Magical);

            var QEtarget = TargetSelector.GetSelectedTarget() ??
                           TargetSelector.GetTarget(EQ.Range, TargetSelector.DamageType.Magical);

            if (Utils.TickCount - W.LastCastAttemptT > Game.Ping + 150 && useE)
            {
                foreach (var enemy in HeroManager.Enemies)
                {
                    if (enemy.IsValidTarget(EQ.Range))
                    {
                        UseE(enemy);
                    }
                }
            }

            if (Wtarget == null && QEtarget != null && useE && Lib.Core.OrbManager.WObject(true) != null)
            {
                EQ.Delay = E.Delay + Q.Range / W.Speed;
                EQ.From  = player.ServerPosition.To2D().Extend(QEtarget.ServerPosition.To2D(), Q.Range).To3D();

                var prediction = EQ.GetPrediction(QEtarget);

                if (prediction.Hitchance >= HitChance.VeryHigh)
                {
                    W.Cast(player.ServerPosition.To2D().Extend(prediction.CastPosition.To2D(), Q.Range - 100));
                    weComboT = Utils.TickCount;
                }
            }
        }
Ejemplo n.º 8
0
 public FxP()
 {
     InitializeComponent();
     EQ.GlobalUiEq = true;
     EQ.Init("Eq");
     EQ.BoostFactor = 1;
 }
Ejemplo n.º 9
0
        public static void DoInterrupt(AIHeroClient Source, Interrupter.InterruptableTargetEventArgs args)
        {
            if (Source.IsMe || Source.IsAlly || args.DangerLevel < Interrupter.DangerLevel.Medium)
            {
                return;
            }
            var e  = MiscMenu.GetCheckbox("inE") && E.IsReady() && Source.IsValidTarget(E.Range);
            var eq = MiscMenu.GetCheckbox("inEQ") && Q.IsReady() && E.IsReady() && Source.IsValidTarget(EQ.Range);


            if (eq)
            {
                var     pred = EQ.GetPrediction(Source);
                Vector3 Qpos = pred.CastPosition;
                if (ObjectManager.Player.Distance(Qpos) <= Q.Range)
                {
                    Q.Cast(Qpos);
                    Main.DoEQ = true;
                }
                else
                {
                    Qpos = ObjectManager.Player.Position.Extend(Qpos, Q.Range);
                    Q.Cast(Qpos);
                    Main.DoEQ = true;
                }
            }

            if (e)
            {
                E.Cast(Source);
            }
        }
Ejemplo n.º 10
0
 public static void Execute()
 {
     if (R.Level == 3 && R.Range < 750)
     {
         R.Range = 750;
     }
     if (Balls.Any())
     {
         foreach (var ball in Balls.Where(x => E.IsInRange(x)))
         {
             var Vector    = player.Position.Extend(ball, EQ.Range);
             var Rectangle = new Geometry.Polygon.Rectangle(Player.Instance.Position.To2D(), Vector, EQ.Width);
             var Count     = EntityManager.Heroes.Enemies.Count(x => x.IsValid() && !x.IsDead && Rectangle.IsInside(Prediction.Position.PredictUnitPosition(x, 300)));
             if (Count >= MenuValue.General.EQHit)
             {
                 E.Cast(ball);
             }
         }
     }
     if (MenuValue.Misc.QKS && Q.IsReady())
     {
         var Target = Q.GetKillableTarget();
         if (Target != null)
         {
             var pred = Q.GetPrediction(Target);
             if (pred.CanNext(Q, MenuValue.General.QHitChance, true))
             {
                 Q.Cast(pred.CastPosition);
             }
         }
     }
     if (MenuValue.Misc.WKS && W.IsReady())
     {
         var Target = W.GetKillableTarget();
         if (Target != null)
         {
             TakeShit_and_Cast(Target);
         }
     }
     if (MenuValue.Misc.EKS && E.IsReady())
     {
         var Target = EQ.GetKillableTarget();
         if (Target != null)
         {
             CastE(Target, MenuValue.Misc.QKS, MenuValue.Misc.WKS);
         }
     }
     if (MenuValue.Misc.RKS && R.IsReady())
     {
         var Target = R.GetKillableTarget();
         if (Target != null)
         {
             R.Cast(Target);
         }
     }
 }
Ejemplo n.º 11
0
        private EQ GetEQ(string EQ01, string EQ02, string EQ03, string EQ04)
        {
            EQ obj = new EQ();

            obj.EQ01 = EQ01;
            obj.EQ02 = EQ02;
            //obj.EQ03 = EQ03;
            //obj.EQ04 = EQ04;
            return(obj);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 値の設定。更新が行われればtrue。setterで利用してください。
 /// </summary>
 /// <typeparam name="TO"></typeparam>
 /// <param name="value"></param>
 /// <param name="THIS"></param>
 /// <param name="propertyName"></param>
 /// <returns></returns>
 public bool Set <TO>(T value, TO THIS, [CallerMemberName] string propertyName = null)
     where TO : NotificationObject
 {
     if (EQ.Equals(store, value))
     {
         return(false);
     }
     store = value;
     THIS.OnPropertyChangedImpl(propertyName);
     return(true);
 }
Ejemplo n.º 13
0
    private bool checkSeen(HashSet <LR0Item> hash, Dictionary <HashSet <LR0Item>, State> seenMap)
    {
        EQ checker = new EQ();

        foreach (KeyValuePair <HashSet <LR0Item>, State> pair in seenMap)
        {
            if (checker.Equals(hash, pair.Key))
            {
                return(true);
            }
        }
        return(false);
    }
Ejemplo n.º 14
0
        private static void UseQe(Obj_AI_Base enemy)
        {
            EQ.Delay = E.Delay + Q.Range / E.Speed;
            EQ.From  = player.ServerPosition.To2D().Extend(enemy.ServerPosition.To2D(), Q.Range).To3D();

            var prediction = EQ.GetPrediction(enemy);

            if (prediction.Hitchance >= HitChance.High)
            {
                Q.Cast(player.ServerPosition.To2D().Extend(prediction.CastPosition.To2D(), Q.Range - 100), true);
                qeComboT           = Utils.TickCount;
                W.LastCastAttemptT = Utils.TickCount;
            }
        }
Ejemplo n.º 15
0
        protected static bool CastE(Obj_AI_Base target, bool useQE, bool useWE)
        {
            if (target != null && E.IsReady())
            {
                switch (E.IsInRange(target))
                {
                case true:
                {
                    var pred = E.GetPrediction(target);
                    if (pred.CanNext(E, MenuValue.General.EHitChance, true))
                    {
                        return(E.Cast(pred.CastPosition));
                    }
                    return(false);
                }

                case false:
                {
                    if (Q.IsReady() && useQE)
                    {
                        var pred = EQ.GetPrediction(target);
                        if (pred.CanNext(EQ, MenuValue.General.EQHitChance, false))
                        {
                            IsCombo = true;
                            return(Q.Cast(player.Position.Extend(pred.CastPosition, E.Range - 20).To3DWorld()));
                        }
                    }
                    else if (W.IsReady() && W.ToggleState == 2 && useWE && IsWHolding)
                    {
                        var pred = EQ.GetPrediction(target);
                        if (pred.CanNext(EQ, MenuValue.General.EQHitChance, false))
                        {
                            IsCombo = true;
                            if (W.Cast(player.Position.Extend(pred.CastPosition, E.Range - 20).To3DWorld()))
                            {
                                LastWCast = Core.GameTickCount;
                                return(true);
                            }
                        }
                        return(false);
                    }
                    return(false);
                }
                }
            }
            return(false);
        }
Ejemplo n.º 16
0
        static void Drawing_OnDraw(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }

            var drawQ    = AIO_Menu.Champion.Drawings.Qrange;
            var drawW    = AIO_Menu.Champion.Drawings.Wrange;
            var drawE    = AIO_Menu.Champion.Drawings.Erange;
            var drawR    = AIO_Menu.Champion.Drawings.Rrange;
            var drawQQr  = AIO_Menu.Champion.Drawings.getCircleValue("QQ Safe Range");
            var drawEQ   = AIO_Menu.Champion.Drawings.getCircleValue("EQ Range");
            var QQTarget = TargetSelector.GetTarget(QQ.Range + Player.MoveSpeed * QQ.Delay, TargetSelector.DamageType.Magical);


            if (Q.IsReady() && drawQ.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Q.Range, drawQ.Color);
            }

            if (EQ.IsReady() && drawEQ.Active)
            {
                Render.Circle.DrawCircle(Player.Position, EQ.Range, drawEQ.Color);
            }

            if (W.IsReady() && drawW.Active)
            {
                Render.Circle.DrawCircle(Player.Position, W.Range, drawW.Color);
            }

            if (E.IsReady() && drawE.Active)
            {
                Render.Circle.DrawCircle(Player.Position, E.Range, drawE.Color);
            }

            if (R.IsReady() && drawR.Active)
            {
                Render.Circle.DrawCircle(Player.Position, R.Range, drawR.Color);
            }

            if (QQ.IsReady() && drawQQr.Active && Player.HasBuff2("yasuoq3w") && QQTarget != null)
            {
                Render.Circle.DrawCircle(Player.Position, QQ.Range - QQTarget.MoveSpeed * QQ.Delay, drawQQr.Color);
            }
        }
Ejemplo n.º 17
0
 private static void UseE(Obj_AI_Base enemy)
 {
     foreach (var orb in Lib.Core.OrbManager.GetOrbs(true))
     {
         if (player.Distance(orb) < E.Range + 100)
         {
             var startPoint = orb.To2D().Extend(player.ServerPosition.To2D(), 100);
             var endPoint   = player.ServerPosition.To2D()
                              .Extend(orb.To2D(), player.Distance(orb) > 200 ? 1300 : 1000);
             EQ.Delay = E.Delay + player.Distance(orb) / E.Speed;
             EQ.From  = orb;
             var enemyPred = EQ.GetPrediction(enemy);
             if (enemyPred.Hitchance >= HitChance.High &&
                 enemyPred.UnitPosition.To2D().Distance(startPoint, endPoint, false)
                 < EQ.Width + enemy.BoundingRadius)
             {
                 E.Cast(orb, true);
                 W.LastCastAttemptT = Utils.TickCount;
                 return;
             }
         }
     }
 }
Ejemplo n.º 18
0
        public static List <Shop> DoFilter(List <Shop> results, int filterby, int fiterByEQ, string number, string query, Coordinate coordinate)
        {
            eq = (EQ)fiterByEQ;
            if (fiterByEQ != 0)
            {
                switch (filterby)
                {
                case 1:
                    results = ShopFilter.FilterShops(results, number, query, ShopFilter.PriceSort);
                    break;

                case 2:
                    if (coordinate == null)
                    {
                        break;
                    }
                    userCoordinate = coordinate;
                    results        = ShopFilter.FilterShops(results, number, query, ShopFilter.DistanceSort);
                    break;
                }
            }
            return(results);
        }
Ejemplo n.º 19
0
        public void ExecuteIn(Vm vm)
        {
            var   lhs = lhExpr.EvalInt(vm);
            RelOp relOp;

            if (relop.s == ">")
            {
                relOp = new GT();
            }
            else if (relop.s == ">=")
            {
                relOp = new GTE();
            }
            else if (relop.s == "<")
            {
                relOp = new LT();
            }
            else if (relop.s == "<=")
            {
                relOp = new LTE();
            }
            else if (relop.s == "<>")
            {
                relOp = new NEQ();
            }
            else
            {
                relOp = new EQ();
            }
            var rhs  = rhExpr.EvalInt(vm);
            var pass = relOp.Execute(lhs, rhs);

            if (pass)
            {
                statement.Command.ExecuteIn(vm);
            }
        }
Ejemplo n.º 20
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
        {
            if (QS.activeSelf)
            {
                AS.SetActive(true);
                QS.SetActive(false);
                ZS.SetActive(false);

                EA.SetActive(true);
                EQ.SetActive(false);
                EZ.SetActive(false);
            }
            else if (AS.activeSelf)
            {
                ZS.SetActive(true);
                QS.SetActive(false);
                AS.SetActive(false);

                EZ.SetActive(true);
                EQ.SetActive(false);
                EA.SetActive(false);
            }
            else if (ZS.activeSelf)
            {
                QS.SetActive(true);
                AS.SetActive(false);
                ZS.SetActive(false);

                EQ.SetActive(true);
                EA.SetActive(false);
                EZ.SetActive(false);
            }
        }
    }
Ejemplo n.º 21
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (InputObject.Expression != null)
            {
                targetCommand.AddParameter("InputObject", InputObject.Get(context));
            }

            if (FilterScript.Expression != null)
            {
                targetCommand.AddParameter("FilterScript", FilterScript.Get(context));
            }

            if (Property.Expression != null)
            {
                targetCommand.AddParameter("Property", Property.Get(context));
            }

            if (Value.Expression != null)
            {
                targetCommand.AddParameter("Value", Value.Get(context));
            }

            if (EQ.Expression != null)
            {
                targetCommand.AddParameter("EQ", EQ.Get(context));
            }

            if (CEQ.Expression != null)
            {
                targetCommand.AddParameter("CEQ", CEQ.Get(context));
            }

            if (NE.Expression != null)
            {
                targetCommand.AddParameter("NE", NE.Get(context));
            }

            if (CNE.Expression != null)
            {
                targetCommand.AddParameter("CNE", CNE.Get(context));
            }

            if (GT.Expression != null)
            {
                targetCommand.AddParameter("GT", GT.Get(context));
            }

            if (CGT.Expression != null)
            {
                targetCommand.AddParameter("CGT", CGT.Get(context));
            }

            if (LT.Expression != null)
            {
                targetCommand.AddParameter("LT", LT.Get(context));
            }

            if (CLT.Expression != null)
            {
                targetCommand.AddParameter("CLT", CLT.Get(context));
            }

            if (GE.Expression != null)
            {
                targetCommand.AddParameter("GE", GE.Get(context));
            }

            if (CGE.Expression != null)
            {
                targetCommand.AddParameter("CGE", CGE.Get(context));
            }

            if (LE.Expression != null)
            {
                targetCommand.AddParameter("LE", LE.Get(context));
            }

            if (CLE.Expression != null)
            {
                targetCommand.AddParameter("CLE", CLE.Get(context));
            }

            if (Like.Expression != null)
            {
                targetCommand.AddParameter("Like", Like.Get(context));
            }

            if (CLike.Expression != null)
            {
                targetCommand.AddParameter("CLike", CLike.Get(context));
            }

            if (NotLike.Expression != null)
            {
                targetCommand.AddParameter("NotLike", NotLike.Get(context));
            }

            if (CNotLike.Expression != null)
            {
                targetCommand.AddParameter("CNotLike", CNotLike.Get(context));
            }

            if (Match.Expression != null)
            {
                targetCommand.AddParameter("Match", Match.Get(context));
            }

            if (CMatch.Expression != null)
            {
                targetCommand.AddParameter("CMatch", CMatch.Get(context));
            }

            if (NotMatch.Expression != null)
            {
                targetCommand.AddParameter("NotMatch", NotMatch.Get(context));
            }

            if (CNotMatch.Expression != null)
            {
                targetCommand.AddParameter("CNotMatch", CNotMatch.Get(context));
            }

            if (Contains.Expression != null)
            {
                targetCommand.AddParameter("Contains", Contains.Get(context));
            }

            if (CContains.Expression != null)
            {
                targetCommand.AddParameter("CContains", CContains.Get(context));
            }

            if (NotContains.Expression != null)
            {
                targetCommand.AddParameter("NotContains", NotContains.Get(context));
            }

            if (CNotContains.Expression != null)
            {
                targetCommand.AddParameter("CNotContains", CNotContains.Get(context));
            }

            if (In.Expression != null)
            {
                targetCommand.AddParameter("In", In.Get(context));
            }

            if (CIn.Expression != null)
            {
                targetCommand.AddParameter("CIn", CIn.Get(context));
            }

            if (NotIn.Expression != null)
            {
                targetCommand.AddParameter("NotIn", NotIn.Get(context));
            }

            if (CNotIn.Expression != null)
            {
                targetCommand.AddParameter("CNotIn", CNotIn.Get(context));
            }

            if (Is.Expression != null)
            {
                targetCommand.AddParameter("Is", Is.Get(context));
            }

            if (IsNot.Expression != null)
            {
                targetCommand.AddParameter("IsNot", IsNot.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Добавить данное событие в очередь
 /// </summary>
 public void Enque()
 {
     EQ.AddEvent(this);
 }
Ejemplo n.º 23
0
 public void Initialize()
 {
     EQ.IntializeEq();
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Добавить другое событие в очередь
 /// </summary>
 /// <param name="ME">Добавляемое событие</param>
 public static void Enque(ModelEvent ME)
 {
     EQ.AddEvent(ME);
 }
Ejemplo n.º 25
0
        public static void DoHarass()
        {
            var q  = HarassMenu.GetCheckbox("useQ") && Q.IsReady();
            var w  = HarassMenu.GetCheckbox("useW") && W.IsReady();
            var eq = HarassMenu.GetCheckbox("useEQ") && E.IsReady() && Q.IsReady();
            var e  = HarassMenu.GetCheckbox("useE") && E.IsReady();


            foreach (var target in ObjectManager.Heroes.Enemies.Where(k => k.IsValidTarget(Q.Range) && !k.IsDead && !k.IsZombie))
            {
                if (q)
                {
                    Q.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    //Chat.Print((Main.MyBalls.Count() + 3) * R.GetDamage(target)/3);
                }
            }

            foreach (var target in ObjectManager.Heroes.Enemies.Where(k => k.IsValidTarget(EQ.Range) && !k.IsDead && !k.IsZombie))
            {
                if (eq && !Functions.HasSpellShield(target))
                {
                    var     pred = EQ.GetPrediction(target);
                    Vector3 Qpos = pred.CastPosition;
                    if (ObjectManager.Player.Distance(Qpos) <= Q.Range)
                    {
                        Q.Cast(Qpos);
                        Main.DoEQ = true;
                    }
                    else
                    {
                        Qpos = ObjectManager.Player.Position.Extend(Qpos, Q.Range);
                        Q.Cast(Qpos);
                        Main.DoEQ = true;
                    }
                }
                //else if (e && !q && !Functions.HasSpellShield(target))
                //{
                //	if (!Main.DoEQ)
                //	{
                //		var ePred = Eex.GetPrediction(target);
                //		if (ePred.Hitchance >= HitChance.VeryHigh)
                //		{
                //			var playerToCP = ObjectManager.Player.Distance(ePred.CastPosition);
                //			foreach (var ball in Main.MyBalls.Where(ball => ObjectManager.Player.Distance(ball.Position) < E.Range))
                //			{
                //				var ballFinalPos = ObjectManager.Player.ServerPosition.Extend(ball.Position, playerToCP);
                //				if (ballFinalPos.Distance(ePred.CastPosition) < 50)
                //					E.Cast(ball.Position);
                //			}
                //		}
                //	}
                //}
            }
            foreach (var target in ObjectManager.Heroes.Enemies.Where(k => k.IsValidTarget(W.Range) && !k.IsDead && !k.IsZombie))
            {
                if (w)
                {
                    if (target.IsValidTarget(W.Range) && W.GetPrediction(target).Hitchance == HitChance.VeryHigh)
                    {
                        if (W.Instance.ToggleState == 1)                                                                                                                                                 // Not holding
                        {
                            var wball   = Main.MyBalls.Find(ball => ball.Distance(ObjectManager.Player) < W.Range - 25);                                                                                 // Look for ball
                            var wminion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, W.Range - 25, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth).FirstOrDefault(); //Look for minion
                            if (wball != null && !wball.IsMoving)
                            {
                                W.Cast(wball);
                            }
                            else if (wminion != null)
                            {
                                W.Cast(wminion);
                                W.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                            }
                        }
                        else                         //holding
                        {
                            W.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                        }
                    }
                }
            }


            foreach (var target in ObjectManager.Heroes.Enemies.Where(k => k.IsValidTarget(Eex.Range) && !k.IsDead && !k.IsZombie))
            {
                if (e && !Main.DoEQ && !Functions.HasSpellShield(target))
                {
                    var ePred = Eex.GetPrediction(target);
                    if (ePred.Hitchance >= HitChance.Low)
                    {
                        var playerToCP = ObjectManager.Player.Distance(ePred.CastPosition);
                        foreach (var eball in Main.MyBalls.Where(ball => ball.Position.Distance(ObjectManager.Player) < E.Range))
                        {
                            var ballFinalPos = ObjectManager.Player.ServerPosition.Extend(eball.Position, playerToCP);
                            if (ballFinalPos.Distance(ePred.CastPosition) < 50)
                            {
                                E.Cast(eball.Position);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 26
0
        static void Main(string[] args)
        {
            //Memoria memoria = new Memoria();
            //Pilha pilha = new Pilha();
            Processador processador = new Processador();
            tipo        num1        = new Inteiro(3);
            tipo        num2        = new Inteiro(5);
            tipo        num3        = new Inteiro(8);


            //Instrucoes instruc = new Push(processador.pilha,num1);
            //instruc.executar();

            //Instrucoes instruc5 = new Store(processador.memoria, processador.pilha, "opa");
            //instruc5.executar();

            //Instrucoes instruc4 = new Pop(processador.pilha);
            //instruc4.executar();

            string[] programa = System.IO.File.ReadAllLines(@"C:/Users/dougl/Desktop/Teste.txt");
            for (int i = 0; i < programa.Length; i++)
            {
                string[] linha = programa[i].Split(' ');
                if (linha[0] == "Label")
                {
                    Instrucoes intruc3 = new Label(processador.pilha, linha[1], i, processador.labels);
                    intruc3.executar();
                }
            }
            for (int i = 0; i < programa.Length; i++)
            {
                string[] linha = programa[i].Split(' ');
                if (linha.Length == 2)
                {
                    switch (linha[0])
                    {
                    case "Push":
                        if (linha[1] == "true")
                        {
                            tipo       parametro = new Booleano(true);
                            Instrucoes intruc    = new Push(processador.pilha, parametro);
                            intruc.executar();
                        }
                        else if (linha[1] == "false")
                        {
                            tipo       parametro = new Booleano(false);
                            Instrucoes intruc1   = new Push(processador.pilha, parametro);
                            intruc1.executar();
                        }
                        else
                        {
                            tipo       parametro = new Inteiro(int.Parse(linha[1]));
                            Instrucoes intruc2   = new Push(processador.pilha, parametro);
                            intruc2.executar();
                        }
                        break;

                    case "Load":
                        Instrucoes intruc4 = new Load(processador.memoria, processador.pilha, linha[1]);
                        intruc4.executar();
                        break;

                    case "Store":
                        Instrucoes intruc5 = new Store(processador.memoria, processador.pilha, linha[1]);
                        intruc5.executar();
                        break;

                    case "GoTo":
                        GoTo intruc6 = new GoTo(processador.labels, linha[1], processador.pilha);
                        intruc6.executar(i);
                        i = intruc6.index;
                        break;

                    case "GoTof":
                        GoTof intruc7 = new GoTof(processador.labels, linha[1], processador.pilha);
                        intruc7.executar(i);
                        i = intruc7.index;
                        break;
                    }
                }
                else if (linha.Length == 1)
                {
                    switch (linha[0])
                    {
                    case "Pop":
                        Instrucoes intruc = new Pop(processador.pilha);
                        intruc.executar();
                        break;

                    case "Add":
                        Instrucoes intruc2 = new Add(processador.pilha);
                        intruc2.executar();
                        break;

                    case "Sub":
                        Instrucoes intruc3 = new Sub(processador.pilha);
                        intruc3.executar();
                        break;

                    case "EQ":
                        Instrucoes intruc4 = new EQ(processador.pilha);
                        intruc4.executar();
                        break;

                    case "GE":
                        Instrucoes intruc5 = new GE(processador.pilha);
                        intruc5.executar();
                        break;

                    case "GT":
                        Instrucoes intruc6 = new GT(processador.pilha);
                        intruc6.executar();
                        break;

                    case "LE":
                        Instrucoes intruc7 = new LE(processador.pilha);
                        intruc7.executar();
                        break;

                    case "LT":
                        Instrucoes intruc8 = new LT(processador.pilha);
                        intruc8.executar();
                        break;

                    case "NE":
                        Instrucoes intruc9 = new NE(processador.pilha);
                        intruc9.executar();
                        break;

                    case "Print":
                        Instrucoes intruc10 = new Print(processador.pilha);
                        intruc10.executar();
                        break;

                    case "Read":
                        Instrucoes intruc11 = new Read(processador.pilha);
                        intruc11.executar();
                        break;

                    case "end":
                        i = programa.Length;
                        break;
                    }
                }
            }

            //Instrucoes instruc3 = new Push(processador.pilha, num2);
            //instruc3.executar();

            //Instrucoes instruc6 = new Load(processador.memoria, processador.pilha, "opa");
            //instruc6.executar();

            //Instrucoes instruc7 = new Add(processador.pilha);
            //instruc7.executar();

            //Instrucoes instruc9 = new Push(processador.pilha, num3);
            //instruc9.executar();

            //Instrucoes instruc8 = new EQ(processador.pilha);
            //instruc8.executar();

            //Instrucoes instruc2 = new Print(processador.pilha);
            //instruc2.executar();

            Console.ReadKey();
        }
Ejemplo n.º 27
0
    public void ImageChange()
    {
        if (Dialog.GetComponent <Dialog> ().LineNumber == 1)
        {
            // fade in
            Fade.GetComponent <Fade>().enabled = true;

            // audio
            Fade.GetComponent <AudioSource>().enabled = false;
            GetComponent <AudioSource> ().enabled     = true;
            croco.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 2)
        {
            croco.SetActive(false);
            carrot.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 3)
        {
            carrot.SetActive(false);
            cookie.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 4)
        {
            cookie.SetActive(false);
            croco.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 5)
        {
            cameleon1.SetActive(false);
            cameleon2.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 6)
        {
            // cameleon fade out
            cameleon2.GetComponent <Fade>().enabled = true;
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 8)
        {
            croco.SetActive(false);
            carrot.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 9)
        {
            carrot.SetActive(false);
            girim.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 10)
        {
            girim.SetActive(false);
            croco.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 11)
        {
            croco.SetActive(false);
            EQ.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 12)
        {
            EQ.SetActive(false);
            croco.SetActive(true);
        }
        else if (Dialog.GetComponent <Dialog> ().LineNumber == 13)
        {
            for (int i = 0; i < button.Length; i++)
            {
                button [i].GetComponent <Button> ().enabled = true;
            }
            Dialog.SetActive(false);
        }
    }
Ejemplo n.º 28
0
        //complete
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (Yasuo.IsDead)
            {
                return;
            }

            Menu menu = MenuHandler.Drawing;

            System.Drawing.Color drawColor = System.Drawing.Color.Blue;

            //Drawing.DrawText(Yasuo.Position.WorldToScreen(), drawColor, Animation, 15);

            //Vector3 yasuoQStartPos = Yasuo.Position + new Vector3(0, 0, 150f),
            //    yasuoQEndPos = yasuoQStartPos.To2D().Extend(Game.CursorPos, Q.Range).To3D((int)yasuoQStartPos.Z - 75);

            //yasuoQStartPos.DrawArrow(yasuoQEndPos, drawColor);
            //Drawing.DrawLine(yasuoQStartPos.WorldToScreen(), yasuoQEndPos.WorldToScreen(), 5, drawColor);

            if (menu.GetCheckboxValue("Draw Q") && !Yasuo.HasBuff("YasuoQ3W") && Q.IsLearned)
            {
                //Drawing.DrawCircle(yasuoQStartPos, Q.Range, drawColor);
                Q.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw Q") && Yasuo.HasBuff("YasuoQ3W") && Q.IsLearned)
            {
                Q3.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw W") && W.IsLearned)
            {
                W.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw E") && E.IsLearned)
            {
                E.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw EQ") && E.IsLearned && Q.IsLearned)
            {
                EQ.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw R") && R.IsLearned)
            {
                R.DrawRange(drawColor);
            }
            if (menu.GetCheckboxValue("Draw Beyblade") && R.IsLearned && Flash != null && E.IsLearned && Q.IsLearned)
            {
                Drawing.DrawCircle(Yasuo.Position, E.Range + Flash.Range + (EQ.Range / 2), System.Drawing.Color.Red);
            }
            if (menu.GetCheckboxValue("Draw Turret Range"))
            {
                foreach (Obj_AI_Turret turret in EntityManager.Turrets.Enemies.Where(a => !a.IsDead && a.VisibleOnScreen))
                {
                    turret.DrawCircle((int)turret.GetAutoAttackRange() + 35, drawColor);
                }
            }

            Obj_AI_Base hoverObject = EntityManager.Enemies.Where(a => !a.IsDead && a.IsTargetable && a.IsInRange(Yasuo, E.Range) && a.Distance(Game.CursorPos) <= 75).OrderBy(a => a.Distance(Game.CursorPos)).FirstOrDefault();

            if (hoverObject != null)
            {
                if (menu.GetCheckboxValue("Draw EQ on Target"))
                {
                    Drawing.DrawCircle(YasuoCalcs.GetDashingEnd(hoverObject), EQ.Range, drawColor);
                }
                if (menu.GetCheckboxValue("Draw E End Position on Target"))
                {
                    Drawing.DrawLine(Yasuo.Position.WorldToScreen(), YasuoCalcs.GetDashingEnd(hoverObject).WorldToScreen(), 3, drawColor);
                }
                if (menu.GetCheckboxValue("Draw E End Position on Target - Detailed"))
                {
                    Vector3 startPos   = Yasuo.Position,
                            dashEndPos = YasuoCalcs.GetDashingEnd(hoverObject),
                            fakeEndPos = startPos.To2D().Extend(dashEndPos.To2D(), 1000).To3D() + new Vector3(0, 0, startPos.Z),
                            slope      = new Vector3(dashEndPos.X - startPos.X, dashEndPos.Y - startPos.Y, 0),
                            fakeSlope  = new Vector3(fakeEndPos.X - startPos.X, fakeEndPos.Y - startPos.Y, 0);

                    List <Vector3> pointsAlongPath  = new List <Vector3>();
                    List <Vector3> straightLinePath = new List <Vector3>();

                    int points = 100;

                    pointsAlongPath.Add(startPos);

                    //get all points in a line from start to fake end
                    for (int i = 0; i < points; i++)
                    {
                        straightLinePath.Add(startPos + (i * (fakeSlope / points)));
                    }

                    bool isWall = false;

                    //get all wall start and end positions
                    for (int i = 0; i < points; i++)
                    {
                        //wall start
                        if (!isWall && straightLinePath[i].IsWall())
                        {
                            pointsAlongPath.Add(straightLinePath[i]);
                            isWall = true;
                        }
                        //wall end
                        if (isWall && !straightLinePath[i].IsWall())
                        {
                            pointsAlongPath.Add(straightLinePath[i]);
                            isWall = false;
                        }
                    }

                    pointsAlongPath.Add(fakeEndPos);

                    for (int i = 0; i < pointsAlongPath.Count() - 1; i++)
                    {
                        System.Drawing.Color color = (pointsAlongPath[i].IsWall()) ? System.Drawing.Color.Red : System.Drawing.Color.Green;
                        Drawing.DrawLine(pointsAlongPath[i].WorldToScreen(), pointsAlongPath[i + 1].WorldToScreen(), 2, color);
                    }

                    Vector3 closestWall             = pointsAlongPath.Where(a => a.IsWall()).OrderBy(a => a.Distance(dashEndPos)).FirstOrDefault(),
                            closestWallsEndPosition = (pointsAlongPath.IndexOf(closestWall) + 1 == pointsAlongPath.Count) ? Vector3.Zero : pointsAlongPath[pointsAlongPath.IndexOf(closestWall) + 1];

                    Drawing.DrawText(closestWall.WorldToScreen(), drawColor, "start", 15);
                    Drawing.DrawText(closestWallsEndPosition.WorldToScreen(), drawColor, "end", 15);
                    Drawing.DrawText(((closestWall + closestWallsEndPosition) / 2).WorldToScreen(), drawColor, closestWall.Distance(closestWallsEndPosition).ToString(), 15);
                    Drawing.DrawText(dashEndPos.WorldToScreen(), drawColor, startPos.Distance(closestWallsEndPosition).ToString(), 15);

                    //none of the points are a wall so the end point is the dash position
                    if (!pointsAlongPath.Any(a => a.IsWall()))
                    {
                        Drawing.DrawCircle(dashEndPos, 50, drawColor);
                    }
                    // OR none of the walls are in the E range
                    else if (pointsAlongPath.Where(a => a.IsWall()).OrderBy(a => a.Distance(startPos)).FirstOrDefault() != null &&
                             pointsAlongPath.Where(a => a.IsWall()).OrderBy(a => a.Distance(startPos)).FirstOrDefault().Distance(startPos) > E.Range)
                    {
                        Drawing.DrawCircle(dashEndPos, 50, drawColor);
                    }
                    //or the dashing end is not a wall
                    else if (!dashEndPos.IsWall())
                    {
                        Drawing.DrawCircle(dashEndPos, 50, drawColor);
                    }
                    //find the nearest wall to the dash position
                    else if (closestWall != Vector3.Zero && closestWallsEndPosition != Vector3.Zero &&
                             closestWall != null && closestWallsEndPosition != null &&
                             closestWallsEndPosition.Distance(dashEndPos) < closestWall.Distance(dashEndPos) &&
                             startPos.Distance(closestWallsEndPosition) <= 630)
                    {
                        Drawing.DrawCircle(closestWallsEndPosition, 50, drawColor);
                    }
                    //the end position is the first wall
                    else
                    {
                        Drawing.DrawCircle(pointsAlongPath.First(a => a.IsWall()), 50, drawColor);
                    }
                }
            }

            if (menu.GetCheckboxValue("Draw Wall Dashes") && E.IsLearned)
            {
                foreach (WallDash wd in YasuoWallDashDatabase.wallDashDatabase.Where(a => a.startPosition.Distance(Yasuo) <= 1300))
                {
                    if (EntityManager.MinionsAndMonsters.Combined.Where(a => a.MeetsCriteria() && a.VisibleOnScreen && a.Name == wd.unitName && a.ServerPosition.Distance(wd.dashUnitPosition) <= 2).FirstOrDefault() != null)
                    {
                        wd.startPosition.DrawArrow(wd.endPosition, System.Drawing.Color.Red, 1);
                        Geometry.Polygon.Circle dashCircle = new Geometry.Polygon.Circle(wd.endPosition, 120);
                        dashCircle.Draw(System.Drawing.Color.Red, 1);
                    }
                }
            }
        }
Ejemplo n.º 29
0
        private void initOperators()
        {
            setName(NEG, "-");
            operators[NEG.operatorIndex()] = new[] {
                unary(NEG, TypeTag.INT, TypeTag.INT),
                unary(NEG, TypeTag.LONG, TypeTag.LONG),
                unary(NEG, TypeTag.FLOAT, TypeTag.DOUBLE),
                unary(NEG, TypeTag.DOUBLE, TypeTag.DOUBLE),
            };

            setName(NOT, "!");
            operators[NOT.operatorIndex()] = new[] {
                unary(NOT, TypeTag.BOOLEAN, TypeTag.BOOLEAN)
            };

            setName(COMPL, "~");
            operators[COMPL.operatorIndex()] = new[] {
                unary(COMPL, TypeTag.INT, TypeTag.INT),
                unary(COMPL, TypeTag.LONG, TypeTag.LONG)
            };

            setName(PRE_INC, "++");
            operators[PRE_INC.operatorIndex()] = new[] {
                unary(PRE_INC, TypeTag.INT, TypeTag.INT, LLVMAdd),
                unary(PRE_INC, TypeTag.LONG, TypeTag.LONG, LLVMAdd),
                unary(PRE_INC, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFAdd),
                unary(PRE_INC, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFAdd)
            };

            setName(PRE_DEC, "--");
            operators[PRE_DEC.operatorIndex()] = new[] {
                unary(PRE_DEC, TypeTag.INT, TypeTag.INT, LLVMSub),
                unary(PRE_DEC, TypeTag.LONG, TypeTag.LONG, LLVMSub),
                unary(PRE_DEC, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFSub),
                unary(PRE_DEC, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFSub)
            };

            setName(POST_INC, "++");
            operators[POST_INC.operatorIndex()] = new[] {
                unary(POST_INC, TypeTag.INT, TypeTag.INT, LLVMAdd),
                unary(POST_INC, TypeTag.LONG, TypeTag.LONG, LLVMAdd),
                unary(POST_INC, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFAdd),
                unary(POST_INC, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFAdd)
            };

            setName(POST_DEC, "--");
            operators[POST_DEC.operatorIndex()] = new[] {
                unary(POST_DEC, TypeTag.INT, TypeTag.INT, LLVMSub),
                unary(POST_DEC, TypeTag.LONG, TypeTag.LONG, LLVMSub),
                unary(POST_DEC, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFSub),
                unary(POST_DEC, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFSub)
            };

            setName(OR, "||");
            operators[OR.operatorIndex()] = new[] {
                binary(OR, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMOr),
            };

            setName(AND, "&&");
            operators[AND.operatorIndex()] = new[] {
                binary(AND, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMAnd),
            };

            // Order of combination listing for binary operators matters for correct resolution
            // More assignable types must be listed after less assignable ones,
            // which is the order listed in the TypeTag enum.

            setName(BITOR, "|");
            operators[BITOR.operatorIndex()] = new[] {
                binary(BITOR, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMOr),
                binary(BITOR, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMOr),
                binary(BITOR, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMOr),
            };

            setName(BITXOR, "^");
            operators[BITXOR.operatorIndex()] = new[] {
                binary(BITXOR, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMXor),
                binary(BITXOR, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMXor),
                binary(BITXOR, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMXor),
            };

            setName(BITAND, "&");
            operators[BITAND.operatorIndex()] = new[] {
                binary(BITAND, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMAnd),
                binary(BITAND, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMAnd),
                binary(BITAND, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMAnd),
            };

            setName(EQ, "==");
            operators[EQ.operatorIndex()] = new[] {
                binary(EQ, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMICmp, LLVMIntEQ),
                binary(EQ, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntEQ),
                binary(EQ, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntEQ),
                binary(EQ, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntEQ),
                binary(EQ, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOEQ),
                binary(EQ, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOEQ),
            };

            setName(NEQ, "!=");
            operators[NEQ.operatorIndex()] = new[] {
                binary(NEQ, TypeTag.BOOLEAN, TypeTag.BOOLEAN, TypeTag.BOOLEAN, LLVMICmp, LLVMIntNE),
                binary(NEQ, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntNE),
                binary(NEQ, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntNE),
                binary(NEQ, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntNE),
                binary(NEQ, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealONE),
                binary(NEQ, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealONE),
            };

            setName(LT, "<");
            operators[LT.operatorIndex()] = new[] {
                binary(LT, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntULT),
                binary(LT, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSLT),
                binary(LT, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSLT),
                binary(LT, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOLT),
                binary(LT, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOLT),
            };

            setName(GT, ">");
            operators[GT.operatorIndex()] = new[] {
                binary(GT, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntUGT),
                binary(GT, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSGT),
                binary(GT, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSGT),
                binary(GT, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOGT),
                binary(GT, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOGT),
            };

            setName(LE, "<=");
            operators[LE.operatorIndex()] = new[] {
                binary(LE, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntULE),
                binary(LE, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSLE),
                binary(LE, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSLE),
                binary(LE, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOLE),
                binary(LE, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOLE),
            };

            setName(GE, ">=");
            operators[GE.operatorIndex()] = new[] {
                binary(GE, TypeTag.CHAR, TypeTag.CHAR, TypeTag.BOOLEAN, LLVMICmp, LLVMIntUGE),
                binary(GE, TypeTag.INT, TypeTag.INT, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSGE),
                binary(GE, TypeTag.LONG, TypeTag.LONG, TypeTag.BOOLEAN, LLVMICmp, LLVMIntSGE),
                binary(GE, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOGE),
                binary(GE, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.BOOLEAN, LLVMFCmp, LLVMRealOGE),
            };

            setName(SHL, "<<");
            operators[SHL.operatorIndex()] = new[] {
                binary(SHL, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMShl),
                binary(SHL, TypeTag.INT, TypeTag.LONG, TypeTag.INT, LLVMShl),
                binary(SHL, TypeTag.LONG, TypeTag.INT, TypeTag.LONG, LLVMShl),
                binary(SHL, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMShl),
            };

            setName(SHR, ">>");
            operators[SHR.operatorIndex()] = new[] {
                binary(SHR, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMLShr),
                binary(SHR, TypeTag.INT, TypeTag.LONG, TypeTag.INT, LLVMLShr),
                binary(SHR, TypeTag.LONG, TypeTag.INT, TypeTag.LONG, LLVMLShr),
                binary(SHR, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMLShr),
            };

            setName(PLUS, "+");
            operators[PLUS.operatorIndex()] = new[] {
                binary(PLUS, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMAdd),
                binary(PLUS, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMAdd),
                binary(PLUS, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFAdd),
                binary(PLUS, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFAdd),
            };

            setName(MINUS, "-");
            operators[MINUS.operatorIndex()] = new[] {
                binary(MINUS, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMSub),
                binary(MINUS, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMSub),
                binary(MINUS, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFSub),
                binary(MINUS, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFSub),
            };

            setName(MUL, "*");
            operators[MUL.operatorIndex()] = new[] {
                binary(MUL, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMMul),
                binary(MUL, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMMul),
                binary(MUL, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFMul),
                binary(MUL, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFMul),
            };

            setName(DIV, "/");
            operators[DIV.operatorIndex()] = new[] {
                binary(DIV, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMSDiv),
                binary(DIV, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMSDiv),
                binary(DIV, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFDiv),
                binary(DIV, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFDiv),
            };

            setName(MOD, "%");
            operators[MOD.operatorIndex()] = new[] {
                binary(MOD, TypeTag.INT, TypeTag.INT, TypeTag.INT, LLVMSRem),
                binary(MOD, TypeTag.LONG, TypeTag.LONG, TypeTag.LONG, LLVMSRem),
                binary(MOD, TypeTag.FLOAT, TypeTag.FLOAT, TypeTag.FLOAT, LLVMFRem),
                binary(MOD, TypeTag.DOUBLE, TypeTag.DOUBLE, TypeTag.DOUBLE, LLVMFRem),
            };
        }
Ejemplo n.º 30
0
 public void Save()
 {
     enh.Save();
     EQ.Save();
 }