Exemple #1
0
        public static bool InCatchRadius(Axe a)
        {
            var mode = Program.Config.Item("catchRadiusMode").GetValue <StringList>().SelectedIndex;

            switch (mode)
            {
            case 1:
                var b =
                    new Geometry.Sector(
                        Player.Position.To2D(), Game.CursorPos.To2D() - Player.Position.To2D(),
                        Program.Config.Item("sectorAngle").GetValue <Slider>().Value *(float)Math.PI / 180,
                        Program.Config.Item("catchRadius").GetValue <Slider>().Value).ToPolygon()
                    .IsOutside(a.AxeObj.Position.Extend(Game.CursorPos, 30).To2D());
                return(!b);

            default:
                return(a.AxeObj.Position.Distance(Game.CursorPos) <
                       Program.Config.Item("catchRadius").GetValue <Slider>().Value);
            }
        }
 public static bool InCatchRadius(Axe a)
 {
     var mode = Program.Config.Item("catchRadiusMode").GetValue<StringList>().SelectedIndex;
     switch (mode)
     {
         case 1:
             var b = new Geometry.Sector(Player.Position.To2D(), Game.CursorPos.To2D() - Player.Position.To2D(), Program.Config.Item("sectorAngle").GetValue<Slider>().Value * (float)Math.PI / 180, Program.Config.Item("catchRadius").GetValue<Slider>().Value).ToPolygon()
                 .IsOutside(a.AxeObj.Position.Extend(Game.CursorPos, 30).To2D());
             return !b;
         default:
             return a.AxeObj.Position.Distance(Game.CursorPos) <
                    Program.Config.Item("catchRadius").GetValue<Slider>().Value;
     }
 }