private void OnMoveListViewItem(PokeblockCaseEventArgs e)
 {
     if (MoveListViewItem != null)
     {
         MoveListViewItem(this, e);
     }
 }
 private void OnAddListViewItem(PokeblockCaseEventArgs e)
 {
     if (AddListViewItem != null)
     {
         AddListViewItem(this, e);
     }
 }
        public void TossPokeblockAt(int index)
        {
            inventory.GameSave.IsChanged = true;
            pokeblocks.RemoveAt(index);

            PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();

            args.Index = index;
            OnRemoveListViewItem(args);
        }
 public void RepopulateListView()
 {
     listViewItems.Clear();
     for (int i = 0; i < pokeblocks.Count; i++)
     {
         PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();
         args.Index     = i;
         args.Pokeblock = pokeblocks[i];
         OnAddListViewItem(args);
     }
 }
        public void AddPokeblock(Pokeblock pokeblock)
        {
            if (caseSize == 0 || pokeblocks.Count < caseSize)
            {
                inventory.GameSave.IsChanged = true;
                pokeblocks.Add(new Pokeblock(this, pokeblock.Color, pokeblock.Spicyness, pokeblock.Dryness, pokeblock.Sweetness, pokeblock.Bitterness, pokeblock.Sourness, pokeblock.Feel, pokeblock.Unknown));

                PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();
                args.Index     = pokeblocks.Count - 1;
                args.Pokeblock = pokeblocks[pokeblocks.Count - 1];
                OnAddListViewItem(args);
            }
        }
        public void AddPokeblock(PokeblockColors color, byte spicy, byte dry, byte sweet, byte bitter, byte sour, byte feel, byte unknown)
        {
            if (caseSize == 0 || pokeblocks.Count < caseSize)
            {
                inventory.GameSave.IsChanged = true;
                pokeblocks.Add(new Pokeblock(this, color, spicy, dry, sweet, bitter, sour, feel, unknown));

                PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();
                args.Index     = pokeblocks.Count - 1;
                args.Pokeblock = pokeblocks[pokeblocks.Count - 1];
                OnAddListViewItem(args);
            }
        }
        public void MovePokeblock(int oldIndex, int newIndex)
        {
            inventory.GameSave.IsChanged = true;
            Pokeblock pokeblock = pokeblocks[oldIndex];

            pokeblocks.RemoveAt(oldIndex);
            pokeblocks.Insert(newIndex, pokeblock);

            PokeblockCaseEventArgs args = new PokeblockCaseEventArgs();

            args.OldIndex  = oldIndex;
            args.NewIndex  = newIndex;
            args.Pokeblock = pokeblock;
            OnMoveListViewItem(args);
        }