Exemplo n.º 1
0
        public PokemonList(PokemonListMode mode)
        {
            this.InitializeComponent();
            Panel[] array = new Panel[]
            {
                this.pkmn1,
                this.pkmn2,
                this.pkmn3,
                this.pkmn4,
                this.pkmn5,
                this.pkmn6
            };
            Label[] array2 = new Label[]
            {
                this.lblName1,
                this.lblName2,
                this.lblName3,
                this.lblName4,
                this.lblName5,
                this.lblName6
            };
            Label[] array3 = new Label[]
            {
                this.lblLevel1,
                this.lblLevel2,
                this.lblLevel3,
                this.lblLevel4,
                this.lblLevel5,
                this.lblLevel6
            };
            Label[] array4 = new Label[]
            {
                this.lblGender1,
                this.lblGender2,
                this.lblGender3,
                this.lblGender4,
                this.lblGender5,
                this.lblGender6
            };
            Label[] array5 = new Label[]
            {
                this.lblHP1,
                this.lblHP2,
                this.lblHP3,
                this.lblHP4,
                this.lblHP5,
                this.lblHP6
            };
            PictureBox[] array6 = new PictureBox[]
            {
                this.pb1,
                this.pb2,
                this.pb3,
                this.pb4,
                this.pb5,
                this.pb6
            };
            ProgressBar[] array7 = new ProgressBar[]
            {
                this.pbHP1,
                this.pbHP2,
                this.pbHP3,
                this.pbHP4,
                this.pbHP5,
                this.pbHP6
            };
            switch (mode)
            {
            case PokemonListMode.Free:
                for (int i = 0; i < array.Length; i++)
                {
                    array[i].ContextMenuStrip = this.contextFree;
                }
                break;

            case PokemonListMode.UseItem:
                for (int i = 0; i < array.Length; i++)
                {
                    array[i].ContextMenuStrip = this.contextItem;
                }
                break;

            case PokemonListMode.Switch:
                for (int i = 0; i < array.Length; i++)
                {
                    array[i].ContextMenuStrip = this.contextSwitch;
                }
                break;
            }
            for (int i = 0; i < Player.Instance.party.Count; i++)
            {
                array[i].Visible = true;
                array6[i].Image  = Player.Instance.party[i].FrontImage;
                array2[i].Text   = (string.IsNullOrEmpty(Player.Instance.party[i].nickname) ? Player.Instance.party[i].baseStats.name : Player.Instance.party[i].nickname);
                switch (Player.Instance.party[i].gender)
                {
                case Gender.Male:
                    array4[i].Text      = "♂";
                    array4[i].ForeColor = Color.Blue;
                    break;

                case Gender.Female:
                    array4[i].Text      = "♀";
                    array4[i].ForeColor = Color.Pink;
                    break;

                default:
                    array4[i].Text = "";
                    break;
                }
                array3[i].Text  = "Lv." + Player.Instance.party[i].Level;
                array5[i].Text  = Player.Instance.party[i].HP + "/" + Player.Instance.party[i].MaxHP;
                array7[i].Value = (int)(Player.Instance.party[i].HP / Player.Instance.party[i].MaxHP * 100);
            }
        }
Exemplo n.º 2
0
 public PokemonList(PokemonListMode mode)
 {
     this.InitializeComponent();
     Panel[] array = new Panel[]
     {
         this.pkmn1,
         this.pkmn2,
         this.pkmn3,
         this.pkmn4,
         this.pkmn5,
         this.pkmn6
     };
     Label[] array2 = new Label[]
     {
         this.lblName1,
         this.lblName2,
         this.lblName3,
         this.lblName4,
         this.lblName5,
         this.lblName6
     };
     Label[] array3 = new Label[]
     {
         this.lblLevel1,
         this.lblLevel2,
         this.lblLevel3,
         this.lblLevel4,
         this.lblLevel5,
         this.lblLevel6
     };
     Label[] array4 = new Label[]
     {
         this.lblGender1,
         this.lblGender2,
         this.lblGender3,
         this.lblGender4,
         this.lblGender5,
         this.lblGender6
     };
     Label[] array5 = new Label[]
     {
         this.lblHP1,
         this.lblHP2,
         this.lblHP3,
         this.lblHP4,
         this.lblHP5,
         this.lblHP6
     };
     PictureBox[] array6 = new PictureBox[]
     {
         this.pb1,
         this.pb2,
         this.pb3,
         this.pb4,
         this.pb5,
         this.pb6
     };
     ProgressBar[] array7 = new ProgressBar[]
     {
         this.pbHP1,
         this.pbHP2,
         this.pbHP3,
         this.pbHP4,
         this.pbHP5,
         this.pbHP6
     };
     switch (mode)
     {
     case PokemonListMode.Free:
         for (int i = 0; i < array.Length; i++)
         {
             array[i].ContextMenuStrip = this.contextFree;
         }
         break;
     case PokemonListMode.UseItem:
         for (int i = 0; i < array.Length; i++)
         {
             array[i].ContextMenuStrip = this.contextItem;
         }
         break;
     case PokemonListMode.Switch:
         for (int i = 0; i < array.Length; i++)
         {
             array[i].ContextMenuStrip = this.contextSwitch;
         }
         break;
     }
     for (int i = 0; i < Player.Instance.party.Count; i++)
     {
         array[i].Visible = true;
         array6[i].Image = Player.Instance.party[i].FrontImage;
         array2[i].Text = (string.IsNullOrEmpty(Player.Instance.party[i].nickname) ? Player.Instance.party[i].baseStats.name : Player.Instance.party[i].nickname);
         switch (Player.Instance.party[i].gender)
         {
         case Gender.Male:
             array4[i].Text = "♂";
             array4[i].ForeColor = Color.Blue;
             break;
         case Gender.Female:
             array4[i].Text = "♀";
             array4[i].ForeColor = Color.Pink;
             break;
         default:
             array4[i].Text = "";
             break;
         }
         array3[i].Text = "Lv." + Player.Instance.party[i].Level;
         array5[i].Text = Player.Instance.party[i].HP + "/" + Player.Instance.party[i].MaxHP;
         array7[i].Value = (int)(Player.Instance.party[i].HP / Player.Instance.party[i].MaxHP * 100);
     }
 }