Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default language on Cards level #11

Open
chucklu opened this issue Aug 3, 2019 · 0 comments
Open

Set default language on Cards level #11

chucklu opened this issue Aug 3, 2019 · 0 comments

Comments

@chucklu
Copy link

chucklu commented Aug 3, 2019

Currently I did not have a chance to set the language through Cards

	static Cards()
		{
			var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HearthDb.CardDefs.xml");
			if(stream == null)
				return;
			using(TextReader tr = new StreamReader(stream))
			{
				var xml = new XmlSerializer(typeof(CardDefs.CardDefs));
				var cardDefs = (CardDefs.CardDefs)xml.Deserialize(tr);
				foreach(var entity in cardDefs.Entites)
				{
					var card = new Card(entity);
					All.Add(entity.CardId, card);
					if(card.Collectible && (card.Type != CardType.HERO || card.Set != CardSet.CORE && card.Set != CardSet.HERO_SKINS))
						Collectible.Add(entity.CardId, card);
				}
			}
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant