示例#1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     win_method =
         new[] { WinMethod.Horizontal, WinMethod.Vertical, WinMethod.Diagonal }
     .OrderBy(_ => __rnd.Next())
     .First();
 }
示例#2
0
        public static void HiddenFromTab(this Window window)
        {
            if (window == null)
            {
                return;
            }
            var handle = window.GetWindowHandle();

            IntPtr exStyle = WinMethod.GetWindowLong(handle, WinConstants.GWL_EXSTYLE);
            int    style   = (int)exStyle | (int)WinConstants.WS_EX_TOOLWINDOW;

            WinMethod.SetWindowLong(handle, WinConstants.GWL_EXSTYLE, style);
        }
示例#3
0
 // file -> new game: resets complete game board to have a rematch
 private void newGameToolStripMenuItem_click(object sender, EventArgs e)
 {
     turn       = Player.Red;
     turn_count = 0;
     win_method =
         new[] { WinMethod.Horizontal, WinMethod.Vertical, WinMethod.Diagonal }
     .OrderBy(_ => __rnd.Next())
     .First();
     foreach (Button b in Controls.OfType <Button>())
     {
         b.Enabled   = true;
         b.BackColor = Color.LightGray;
     }
 }
 public BattleGym(Pokemon _PlayerPokemon, Pokemon _OpponentPokemon, WinMethod _Win, LoseMethod _Lose)
 { //Winmethod and Losemethod passed in from presenter module (Define the change in view?)
     rand            = new Random();
     PlayerPokemon   = _PlayerPokemon;
     OpponentPokemon = _OpponentPokemon;
     win             = _Win;
     lose            = _Lose;
     ppSkilltime     = new int[3] {
         1, 20, 50
     };
     opSkilltime = new int[3] {
         2, 25, 55
     };
     CurrentTurn = 1;
     if (PlayerPokemon.GetCP > 2000)
     {
         PlayerCriticalRate = 0.3;
     }
     else if (PlayerPokemon.GetCP > 1000)
     {
         PlayerCriticalRate = 0.2;
     }
     else
     {
         PlayerCriticalRate = 0.1;
     }
     if (OpponentPokemon.GetCP > 2000)
     {
         OpponentCriticalRate = 0.3;
     }
     else if (OpponentPokemon.GetCP > 1000)
     {
         OpponentCriticalRate = 0.2;
     }
     else
     {
         OpponentCriticalRate = 0.1;
     }
 }
示例#5
0
 public BattleGym(Pokemon _PlayerPokemon, Pokemon _OpponentPokemon, WinMethod _Win, LoseMethod _Lose)
 { //Winmethod and Losemethod passed in from presenter module (Define the change in view?)
     rand            = new Random();
     PlayerPokemon   = _PlayerPokemon;
     OpponentPokemon = _OpponentPokemon;
     win             = _Win;
     lose            = _Lose;
     skilltime       = new int[3] {
         20, 5, 1
     };                                   // How many times can be used for each skill
     opponentSkilltime = new int[3] {
         40, 20, 10
     };                                             // How many times can be used for each skill for opponentPokemon
     CurrentTurn = 1;
     if (PlayerPokemon.GetCP > 2000)
     {
         PlayerCriticalRate = 0.3;
     }
     else if (PlayerPokemon.GetCP > 1000)
     {
         PlayerCriticalRate = 0.2;
     }
     else
     {
         PlayerCriticalRate = 0.1;
     }
     if (OpponentPokemon.GetCP > 2000)
     {
         OpponentCriticalRate = 0.3;
     }
     else if (OpponentPokemon.GetCP > 1000)
     {
         OpponentCriticalRate = 0.2;
     }
     else
     {
         OpponentCriticalRate = 0.1;
     }
 }
示例#6
0
 /// <summary>
 /// Creates a new <see cref="WinState"/>.
 /// </summary>
 /// <param name="method">The method to win on.</param>
 /// <param name="winner">The winner.</param>
 internal WinState(WinMethod method, BoardSlotValue?winner = null)
 {
     Method = method;
     Winner = winner;
 }
示例#7
0
        private void ToggleDesktopIcons()
        {
            IntPtr hWnd = WinMethod.FindWindowEx(IntPtr.Zero, IntPtr.Zero, "SysListView32", null);

            WinMethod.ShowWindow(hWnd, 0);
        }
示例#8
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_window_get_arrangement(winid_t win, out WinMethod method,
                                                      out uint sizeptr, out winid_t keywinptr);
示例#9
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_window_set_arrangement(winid_t win, WinMethod method,
                                                      uint size, winid_t keywin);
示例#10
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern winid_t glk_window_open(winid_t split, WinMethod method, uint size,
                                              WinType wintype, uint rock);
示例#11
0
 /// <summary>
 /// Creates a new <see cref="WinStateCalculatorResult"/>.
 /// </summary>
 /// <param name="method">The method one has one by.</param>
 /// <param name="winner">The winner, if any.</param>
 public WinStateCalculatorResult(WinMethod method, BoardSlotValue?winner = null)
 {
     Method = method;
     Winner = winner;
 }