public void UpdateCards(List <Witcher3GwentCard> OwnedUnitCards, List <Witcher3GwentCard> OwnedLeaderCards) { Dictionary <int, Witcher3GwentCard> OwnedCards = new Dictionary <int, Witcher3GwentCard>(); foreach (Witcher3GwentCard thecard in OwnedUnitCards) { OwnedCards[thecard.cardIndex] = thecard; } foreach (Witcher3GwentCard thecard in OwnedLeaderCards) { OwnedCards[thecard.cardIndex] = thecard; } numowned = 0; foreach (GwentCardViewModel model in _cards) { if (OwnedCards.ContainsKey(model.ID)) { Witcher3GwentCard owned = OwnedCards[model.ID]; model.IsChecked = true; model.NumHeld = owned.numCopies; numowned++; } } CollectEmAllStatus = "Collect 'em all: " + numowned.ToString() + "/" + BaseGameCards.Count.ToString(); }
public void LoadInfo(List <Witcher3GwentCard> _baseGameCards, List <Witcher3GwentCard> OwnedUnitCards, List <Witcher3GwentCard> OwnedLeaderCards) { BaseGameCards = _baseGameCards; ObservableCollection <GwentCardViewModel> temp = new ObservableCollection <GwentCardViewModel>(); Dictionary <int, Witcher3GwentCard> OwnedCards = new Dictionary <int, Witcher3GwentCard>(); foreach (Witcher3GwentCard thecard in OwnedUnitCards) { OwnedCards[thecard.cardIndex] = thecard; } foreach (Witcher3GwentCard thecard in OwnedLeaderCards) { OwnedCards[thecard.cardIndex] = thecard; } numowned = 0; foreach (Witcher3GwentCard thecard in BaseGameCards) { bool isowned = false; if (OwnedCards.ContainsKey(thecard.cardIndex)) { Witcher3GwentCard owned = OwnedCards[thecard.cardIndex]; thecard.numCopies = owned.numCopies; isowned = true; numowned++; } GwentCardViewModel model = new GwentCardViewModel(thecard); model.IsChecked = isowned; temp.Add(model); } temp.Sort(); CollectEmAllStatus = "Collect 'em all: " + numowned.ToString() + "/" + BaseGameCards.Count.ToString(); _cards = temp; }
private void SetGwentCardStatuses() { Dictionary <int, Witcher3GwentCard> OwnedCards = new Dictionary <int, Witcher3GwentCard>(); foreach (Witcher3GwentCard thecard in ActiveSave.GwentManager.RegularCards) { OwnedCards[thecard.cardIndex] = thecard; } foreach (Witcher3GwentCard thecard in ActiveSave.GwentManager.LeaderCards) { OwnedCards[thecard.cardIndex] = thecard; } numowned = 0; foreach (Witcher3GwentCard thecard in BaseGame) { bool isowned = false; if (OwnedCards.ContainsKey(thecard.cardIndex)) { Witcher3GwentCard owned = OwnedCards[thecard.cardIndex]; thecard.numCopies = owned.numCopies; isowned = true; numowned++; } GwentCardViewModel model = new GwentCardViewModel(thecard); model.IsChecked = isowned; _cards.Add(model); } StatusText = "Currently have [" + numowned.ToString() + "/" + BaseGame.Count.ToString() + "]"; //foreach (Witcher3GwentCard thecard in ActiveSave.GwentManager.LeaderCards) // _cards.Add(new GwentCardViewModel(thecard)); }
public GwentCardViewModel(Witcher3GwentCard thecard) { _id = thecard.cardIndex; _numHeld = thecard.numCopies; _name = thecard.Name; _location = thecard.Location; }
private void GetGwentCardList() { var reader = new Readers.GwentXMLReader(Path.Combine(appdir, "Gwent.xml")); BaseGameGwentCards = new List <Witcher3GwentCard>(); foreach (Readers.GwentCardAsRead cardasread in reader.Sets[0].Cards) { Witcher3GwentCard card = new Witcher3GwentCard(); card.cardIndex = cardasread.ID; card.Name = cardasread.Name; card.Location = cardasread.Location; card.AssociatedQuest = cardasread.AssociatedQuest; BaseGameGwentCards.Add(card); } }
private void GetGwentCardList() { var reader = new Witcher3MapViewer.Readers.GwentXMLReader(Path.Combine(@"C:\Users\Reuben\Dropbox\Programs\Witcher3MapViewer\Witcher3MapViewer\Witcher3MapViewer\bin\x64\Debug", "Gwent.xml")); BaseGame = new List <Witcher3GwentCard>(); foreach (Witcher3MapViewer.Readers.GwentCardAsRead cardasread in reader.Sets[0].Cards) { Witcher3GwentCard card = new Witcher3GwentCard(); card.cardIndex = cardasread.ID; card.Name = cardasread.Name; card.Location = cardasread.Location; card.AssociatedQuest = cardasread.AssociatedQuest; BaseGame.Add(card); } }
private bool AlreadyHaveThatCard(Witcher3GwentCard thecard) { //var foo = _cards.Where(item => item.IDNumber == thecard.cardIndex).FirstOrDefault(); //if (foo != null) //{ // if (foo.NumHeld != thecard.numCopies) // { // foo.NumHeld = thecard.numCopies; // foo.IsObtained = true; // } // else if(updatedtimer.ElapsedMilliseconds > 10000) foo.IsObtained = false; // return true; //} //return false; return(false); }