private void Form1_Load(object sender, EventArgs e) { win_method = new[] { WinMethod.Horizontal, WinMethod.Vertical, WinMethod.Diagonal } .OrderBy(_ => __rnd.Next()) .First(); }
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); }
// 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; } }
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; } }
/// <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; }
private void ToggleDesktopIcons() { IntPtr hWnd = WinMethod.FindWindowEx(IntPtr.Zero, IntPtr.Zero, "SysListView32", null); WinMethod.ShowWindow(hWnd, 0); }
public static extern void glk_window_get_arrangement(winid_t win, out WinMethod method, out uint sizeptr, out winid_t keywinptr);
public static extern void glk_window_set_arrangement(winid_t win, WinMethod method, uint size, winid_t keywin);
public static extern winid_t glk_window_open(winid_t split, WinMethod method, uint size, WinType wintype, uint rock);
/// <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; }