예제 #1
0
        public void Action(WidthHeight img, int time)
        {
            var adbDirectoryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AndoridAdb");
            var adbPath          = Path.Combine(adbDirectoryPath, "adb.exe");

            var point1 = new Point();

            point1.X = this.Rand.Next(100, img.Width - 200);
            point1.Y = this.Rand.Next(100, img.Height - 300);

            var point2 = new Point();

            point2.X = this.Rand.Next(100, img.Width - 200);
            point2.Y = this.Rand.Next(100, img.Height - 300);

            using (Process process = new Process())
            {
                //process.StartInfo.WorkingDirectory = adbDirectoryPath;
                process.StartInfo.FileName               = adbPath;
                process.StartInfo.Arguments              = String.Format("shell input swipe {0} {1} {2} {3} {4}", point1.X, point1.Y, point2.X, point2.Y, time);
                process.StartInfo.UseShellExecute        = false;
                process.StartInfo.RedirectStandardInput  = true;  //重定向标准输入
                process.StartInfo.RedirectStandardOutput = true;  //重定向标准输出
                process.StartInfo.RedirectStandardError  = true;  //重定向错误输出
                process.StartInfo.CreateNoWindow         = true;
                process.Start();
                var result = process.StandardOutput.ReadToEnd();
                process.WaitForExit();
            }
        }
예제 #2
0
        public void updateFovMap(int level, FovMap fovMap)
        {
            TCODFov tcodLevel = new TCODFov(fovMap.Width, fovMap.Height);

            for (int j = 0; j < fovMap.Width; j++)
            {
                for (int k = 0; k < fovMap.Height; k++)
                {
                    if (fovMap.getCell(j, k) != FOVTerrain.Blocking)
                        tcodLevel.SetCell(j, k, true, false);
                    else
                        tcodLevel.SetCell(j, k, false, false);
                }
            }

            levelTCODMaps[level] = tcodLevel;
            levelTCODMapSizes[level] = new WidthHeight(fovMap.Width, fovMap.Height);
        }
예제 #3
0
        public void updateFovMap(int level, FovMap fovMap)
        {
            TCODFov tcodLevel = new TCODFov(fovMap.Width, fovMap.Height);

            for (int j = 0; j < fovMap.Width; j++)
            {
                for (int k = 0; k < fovMap.Height; k++)
                {
                    if (fovMap.getCell(j, k) != FOVTerrain.Blocking)
                    {
                        tcodLevel.SetCell(j, k, true, false);
                    }
                    else
                    {
                        tcodLevel.SetCell(j, k, false, false);
                    }
                }
            }

            levelTCODMaps[level]     = tcodLevel;
            levelTCODMapSizes[level] = new WidthHeight(fovMap.Width, fovMap.Height);
        }
예제 #4
0
 public void Action(WidthHeight img, int time)
 {
     throw new NotImplementedException();
 }