当前位置: 首页>>代码示例>>C#>>正文


C# Position.Get方法代码示例

本文整理汇总了C#中Position.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Position.Get方法的具体用法?C# Position.Get怎么用?C# Position.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Position的用法示例。


在下文中一共展示了Position.Get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindIf

 internal static Position FindIf(Position begin, Position end, IPredicate1 f)
 {
     while (begin != end && !f.Execute(begin.Get())) {
         ++begin;
     }
     return begin;
 }
开发者ID:Aleksandar7kr,项目名称:ETU,代码行数:7,代码来源:utility.cs

示例2: Find

 internal static Position Find(Position begin, Position end, char value)
 {
     while (begin != end && begin.Get() != value) {
         ++begin;
     }
     return begin;
 }
开发者ID:Aleksandar7kr,项目名称:ETU,代码行数:7,代码来源:utility.cs

示例3: Equal

 internal static bool Equal(Position begin, Position end, string s)
 {
     int i = 0;
     while (begin != end && begin.Get() == s[i]) {
         begin++;
         i++;
     }
     return begin == end;
 }
开发者ID:Aleksandar7kr,项目名称:ETU,代码行数:9,代码来源:utility.cs

示例4: AdjacentFind

 internal static Position AdjacentFind(Position begin, Position end, IPredicate2 f)
 {
     Position result = begin;
     if (begin != end) {
         while (++begin != end && !f.Execute(result.Get(), begin.Get())) {
             result = begin;
         }
     }
     return (begin == end) ? end : result;
 }
开发者ID:Aleksandar7kr,项目名称:ETU,代码行数:10,代码来源:utility.cs

示例5: BotManager

        public void BotManager()
        {
            _surrender = Convert.ToBoolean( ConfigurationManager.AppSettings["enable_surrender"] );
            if (_surrender)
                Base.Write("Automatic Surrender: Enabled", ConsoleColor.White);
            else
                Base.Write("Automatic Surrender: Disabled", ConsoleColor.White);

            try
            {
               positions = new Position();
               Base.Write("Bot initialized with resolution " + positions.resolution, ConsoleColor.White);
            }
            catch (Exception e)
            {
                Base.Write(e);
                System.Environment.Exit(1);
            }

            System.Threading.Timer afkTimer = null;
            System.Threading.Timer surrenderTimer = null;

            bool actionNeeded = false;

            while (true)
            {
                Thread.Sleep(5000);
                statusType oldStatus = status;
                actionNeeded = GetStatus();

                if ( !oldStatus.Equals(status) || actionNeeded)
                {
                    actionNeeded = GetStatus(true);

                    //dispose of timers
                    if (afkTimer != null) afkTimer.Dispose();
                    if (surrenderTimer != null) surrenderTimer.Dispose();

                    if (status.WindowStatus == WindowStatusType.Game)
                    {
                        if (status.GameStatus == GameStatusType.InProgress)
                        {
                            if (_surrender)
                            {
                                Base.Write("Starting Anti-AFK and Auto-Surrender", ConsoleColor.White);
                                afkTimer = new System.Threading.Timer(AntiAfk, null, 15000, 10000);
                                surrenderTimer = new System.Threading.Timer(AttemptSurrender, null, 60000, 60000);
                            }
                            else
                            {
                                Base.Write("Starting Anti-AFK", ConsoleColor.White);
                                afkTimer = new System.Threading.Timer(AntiAfk, null, 15000, 10000);
                            }
                        }
                        else
                        { //in victory or defeat game screens
                            Base.Write("Leaving game screen...");

                            Cursor.Position = RelativePoint(gameWindowDimensions, positions.Get("end_game_button"));
                            BringWindowToTop(Base.gameWindowName, false);
                            Thread.Sleep(1000);
                            new InputSimulator().Mouse.LeftButtonClick();
                        }
                    }
                    else
                    {
                        if (status.ClientStatus == ClientStatusType.LevelUp)
                        {
                            Base.Write("Clearing popup", ConsoleColor.White);
                            BringWindowToTop(Base.clientWindowName, true);
                            Cursor.Position = RelativePoint(clientWindowDimensions, positions.Get("level_up_button"));
                            Thread.Sleep(1000);
                            new InputSimulator().Mouse.LeftButtonClick();

                        }
                        if (status.ClientStatus == ClientStatusType.ScoreScreen)
                        {
                            if (Abort)
                            {
                                Console.Beep();
                                Base.Write("Game Over. Aborting...");
                                Base.Close();
                            }
                            Base.Write("Clicking \"Play Again\" in a moment");
                            BringWindowToTop(Base.clientWindowName, true);
                            Cursor.Position = RelativePoint(clientWindowDimensions, positions.Get("play_again_button"));
                            Thread.Sleep(1000);
                            new InputSimulator().Mouse.LeftButtonClick();

                        }
                        else if (status.ClientStatus == ClientStatusType.Unqueued)
                        {
                            if (Abort)
                            {
                                Console.Beep();
                                Base.Write("Game Over. Aborting...");
                                Base.Close();
                            }
                            Base.Write("Clicking \"Play Again\" in a moment");
                            BringWindowToTop(Base.clientWindowName, true);
//.........这里部分代码省略.........
开发者ID:Hebo,项目名称:LeagueMaster,代码行数:101,代码来源:Bot.cs

示例6: Match

 internal static bool Match(Position begin, Position end)
 {
     return begin != end && begin.Get() == '#';
 }
开发者ID:Aleksandar7kr,项目名称:ETU,代码行数:4,代码来源:directive_token.cs


注:本文中的Position.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。