internal void Init(BoardOutward board, int observeTeam)
        {
            Board                = board;
            ObserveTeam          = observeTeam;
            Player0.ItemsSource  = board.Players[observeTeam, 0].Balls;
            PlayerO0.ItemsSource = board.Players[1 - observeTeam, 0].Balls;
            P0.SetPokemon(board[observeTeam, 0]);
            PO0.SetPokemon(board[1 - observeTeam, 0]);
            if (Board.Settings.Mode.PlayersPerTeam() == 2)
            {
                Player1.ItemsSource  = board.Players[observeTeam, 1].Balls;
                PlayerO1.ItemsSource = board.Players[1 - observeTeam, 1].Balls;
                P1.SetPokemon(board[observeTeam, 1]);
                PO1.SetPokemon(board[1 - observeTeam, 1]);
            }
            else
            {
                Player1.ItemsSource = PlayerO1.ItemsSource = null;
                P1.SetPokemon(null);
                PO1.SetPokemon(null);
            }
            board.PokemonSentOut += OnPokemonSentOut;

            if (Board.Settings.Mode.PlayersPerTeam() != 2)
            {
                p4p.Visibility  = System.Windows.Visibility.Collapsed;
                p4p2.Visibility = System.Windows.Visibility.Collapsed;
            }
            else
            {
                p4p.Visibility  = System.Windows.Visibility.Visible;
                p4p2.Visibility = System.Windows.Visibility.Visible;
            }
        }
Exemple #2
0
 internal void Init(BoardOutward board, int observeTeam)
 {
     Board                = board;
     ObserveTeam          = observeTeam;
     Player0.ItemsSource  = board.Players[observeTeam, 0].Balls;
     PlayerO0.ItemsSource = board.Players[1 - observeTeam, 0].Balls;
     P0.SetPokemon(board[observeTeam, 0]);
     PO0.SetPokemon(board[1 - observeTeam, 0]);
     if (Board.Settings.Mode.PlayersPerTeam() == 2)
     {
         Player1.ItemsSource  = board.Players[observeTeam, 1].Balls;
         PlayerO1.ItemsSource = board.Players[1 - observeTeam, 1].Balls;
         P1.SetPokemon(board[observeTeam, 1]);
         PO1.SetPokemon(board[1 - observeTeam, 1]);
     }
     else
     {
         Player1.ItemsSource = PlayerO1.ItemsSource = null;
         P1.SetPokemon(null);
         PO1.SetPokemon(null);
     }
     board.PokemonSentOut += OnPokemonSentOut;
 }
Exemple #3
0
 static void WL1(string name, PO1 line, string qty, Dictionary <string, List <(PO1 PO1, string qty)> > dict)
        public void Set(int userX, MoveRange range)
        {
            CanSelect = false;
            //如果要支持三打对战,IsRemote要拿到客户端
            PO1.IsEnabled = false;
            PO0.IsEnabled = false;
            P0.IsEnabled  = false;
            P1.IsEnabled  = false;
            var user    = userX == 0 ? P0 : P1;
            var partner = user == P0 ? P1 : P0;

            switch (range)
            {
            case MoveRange.SelectedTarget:
                CanSelect         = true;
                PO1.IsEnabled     = true;
                PO0.IsEnabled     = true;
                partner.IsEnabled = true;
                break;

            case MoveRange.SelectedTeammate:
                CanSelect         = true;
                partner.IsEnabled = true;
                break;

            case MoveRange.SelectedOpponent:
                CanSelect     = true;
                PO1.IsEnabled = true;
                PO0.IsEnabled = true;
                break;

            case MoveRange.Adjacent:
                PO1.IsEnabled     = true;
                PO0.IsEnabled     = true;
                partner.IsEnabled = true;
                break;

            case MoveRange.OpponentPokemons:
            case MoveRange.OpponentField:
                PO1.IsEnabled = true;
                PO0.IsEnabled = true;
                break;

            case MoveRange.TeamPokemons:
            case MoveRange.TeamField:
                P0.IsEnabled = true;
                P1.IsEnabled = true;
                break;

            case MoveRange.All:
            case MoveRange.Board:
                PO1.IsEnabled = true;
                PO0.IsEnabled = true;
                P0.IsEnabled  = true;
                P1.IsEnabled  = true;
                break;

            default:
                user.IsEnabled = true;
                break;
            }
            PO1.OnPropertyChanged();
            PO0.OnPropertyChanged();
            P0.OnPropertyChanged();
            P1.OnPropertyChanged();
            OnPropertyChanged();
        }