public ManagerGameSave() { Random random = new Random((int)DateTime.Now.Ticks); this.trainerName = "TRIGSPC"; this.trainerGender = (Genders)random.Next(2); this.trainerID = (ushort)random.Next(ushort.MaxValue); this.secretID = (ushort)random.Next(ushort.MaxValue); this.playTime = new TimeSpan(); this.lastSaveTime = DateTime.Now; this.pokedexSeen = new bool[386]; this.pokedexOwned = new bool[386]; this.money = 0; this.coins = 0; this.battlePoints = 0; this.pokeCoupons = 0; this.volcanicAsh = 0; this.pokePCs = new List<ManagerPokePC>(); this.pokePCs.Add(new ManagerPokePC(this, "Row 1")); this.inventory = new Inventory(this); this.mailbox = new Mailbox(this, 0); this.inventory.AddItemInventory(); this.inventory.Items.AddPocket(ItemTypes.Items, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.InBattle, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.Valuables, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.Hold, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.Misc, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.PokeBalls, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.TMCase, 0, 0, false, true); this.inventory.Items.AddPocket(ItemTypes.Berries, 0, 0, false, true); this.inventory.Items.AddPocket(ItemTypes.KeyItems, 0, 0, false, false); this.inventory.Items.AddPocket(ItemTypes.CologneCase, 0, 0, false, true); this.inventory.Items.AddPocket(ItemTypes.DiscCase, 0, 0, false, true); this.inventory.AddDecorationInventory(); this.inventory.Decorations.AddPocket(DecorationTypes.Desk, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Chair, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Plant, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Ornament, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Mat, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Poster, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Doll, 0, 0); this.inventory.Decorations.AddPocket(DecorationTypes.Cushion, 0, 0); this.inventory.AddPokeblockCase(0); loaded = true; }
public void UnloadMailbox() { listViewItems.ItemsSource = null; if (mailbox != null) { dropManager.ListView = null; dropManager.ProcessDrop -= OnProcessDrop; mailbox.AddListViewItem -= OnAddListViewItem; mailbox.RemoveListViewItem -= OnRemoveListViewItem; mailbox.MoveListViewItem -= OnMoveListViewItem; mailbox = null; dropManager = null; } }
public void LoadMailbox(Mailbox mailbox) { UnloadMailbox(); this.mailbox = mailbox; this.selectedIndex = -1; mailbox.AddListViewItem += OnAddListViewItem; mailbox.RemoveListViewItem += OnRemoveListViewItem; mailbox.MoveListViewItem += OnMoveListViewItem; listViewItems.ItemsSource = mailbox.ListViewItems; dropManager = new ListViewDragDropManager<ListViewItem>(listViewItems); dropManager.ProcessDrop += OnProcessDrop; UpdateDetails(); mailbox.RepopulateListView(); int numPartyMail = 0; for (int i = 0; i < 6; i++) { if (i < mailbox.PartyMailCount && mailbox[i, true] != null) numPartyMail++; } buttonTakeMail.IsEnabled = numPartyMail > 0; }