本文整理汇总了C#中Hearthstone_Deck_Tracker.Hearthstone.Card类的典型用法代码示例。如果您正苦于以下问题:C# Card类的具体用法?C# Card怎么用?C# Card使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Card类属于Hearthstone_Deck_Tracker.Hearthstone命名空间,在下文中一共展示了Card类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CardInCollection
public CardInCollection(Card card, int amountNonGolden = 0, int amountGolden = 0)
{
Card = card;
AmountNonGolden = amountNonGolden;
AmountGolden = amountGolden;
DesiredAmount = MaxAmountInCollection;
}
示例2: Game
static Game()
{
Entities = new Dictionary<int, Entity>();
CurrentGameMode = GameMode.None;
IsInMenu = true;
SetAsideCards = new List<string>();
OpponentReturnedToDeck = new List<KeyValuePair<string, int>>();
PlayerDeck = new ObservableCollection<Card>();
PlayerDrawn = new ObservableCollection<Card>();
OpponentCards = new ObservableCollection<Card>();
PossibleArenaCards = new List<Card>();
PossibleConstructedCards = new List<Card>();
_cardDb = new Dictionary<string, Card>();
OpponentHandAge = new int[MaxHandSize];
OpponentHandMarks = new CardMark[MaxHandSize];
OpponentStolenCardsInformation = new Card[MaxHandSize];
OpponentSecrets = new OpponentSecrets();
for(var i = 0; i < MaxHandSize; i++)
{
OpponentHandAge[i] = -1;
OpponentHandMarks[i] = CardMark.None;
}
LoadCardDb(Helper.LanguageDict.ContainsValue(Config.Instance.SelectedLanguage) ? Config.Instance.SelectedLanguage : "enUS");
}
示例3: GameV2
public GameV2()
{
Entities = new Dictionary<int, Entity>();
CurrentGameMode = GameMode.None;
IsInMenu = true;
SetAsideCards = new List<string>();
OpponentReturnedToDeck = new List<KeyValuePair<string, int>>();
PlayerDeck = new ObservableCollection<Card>();
PlayerDrawn = new ObservableCollection<Card>();
PlayerDrawnIdsTotal = new ObservableCollection<string>();
OpponentCards = new ObservableCollection<Card>();
PossibleArenaCards = new List<Card>();
PossibleConstructedCards = new List<Card>();
OpponentHandAge = new int[MaxHandSize];
OpponentHandMarks = new CardMark[MaxHandSize];
OpponentStolenCardsInformation = new Card[MaxHandSize];
OpponentSecrets = new OpponentSecrets();
for(var i = 0; i < MaxHandSize; i++)
{
OpponentHandAge[i] = -1;
OpponentHandMarks[i] = CardMark.None;
}
}
示例4: GetSearchString
public static string GetSearchString(Card card)
{
var searchString = card.LocalizedName.ToLowerInvariant();
if(AddArtist)
searchString += " " + card.Artist.ToLowerInvariant();
searchString += GetSpecialSearchCases(card.Name);
return searchString;
}
示例5: CardStats
public CardStats(string id)
{
card = Database.GetCardFromId(id);
drawn = 0;
played = 0;
won = 0;
loss = 0;
}
示例6: CardObject
public CardObject(Card card)
{
if(card != null)
{
id = card.Id;
count = card.Count.ToString();
}
}
示例7: GetBattleCryFor
// todo make choose random not just first;
public SoundPlaySetting GetBattleCryFor(Card card, CardSource cardSource)
{
var soundPlaySetting = _configManager.Config.SoundFiles.FirstOrDefault((sound) =>
{
return (sound.CardSource == CardSource.All || cardSource == sound.CardSource) && sound.CardId == card.Id;
});
return soundPlaySetting;
}
示例8: CardBarImageBuilder
protected CardBarImageBuilder(Card card, string dir)
{
Card = card;
ThemeDir = dir;
TextTypeFace = Helper.LatinLanguages.Contains(Config.Instance.SelectedLanguage)
? NumbersTypeFace : new Typeface(new FontFamily(), FontStyles.Normal, FontWeights.Bold, FontStretches.Condensed);
HasAllRequired = Required.All(x => File.Exists(Path.Combine(ThemeDir, x.Value.FileName)));
HasAllOptionalFrames = OptionalFrame.All(x => File.Exists(Path.Combine(ThemeDir, x.Value.FileName)));
HasAllOptionalGems = OptionalGems.All(x => File.Exists(Path.Combine(ThemeDir, x.Value.FileName)));
HasAllOptionalCountBoxes = OptionalCountBoxes.All(x => File.Exists(Path.Combine(ThemeDir, x.Value.FileName)));
}
示例9: OnPlay
private void OnPlay(Card card, CardSource cardSource)
{
var soundToPlay = _cardSoundPicker.GetBattleCryFor(card, cardSource);
if(soundToPlay == null)
{
Hearthstone_Deck_Tracker.Logger.WriteLine("BattleCry SFX not found");
return;
}
_soundBoard.Play(soundToPlay);
Hearthstone_Deck_Tracker.Logger.WriteLine("BattleCry Sound Effect Triggered");
}
示例10: CardImageBuilder
public CardImageBuilder(Card card)
{
_card = card;
}
示例11: IsActualCard
// TODO: possibly refactor with GetActualCards, reduce duplication
public static bool IsActualCard(Card card)
{
if(card == null)
return false;
return (card.Type == "Minion" || card.Type == "Spell" || card.Type == "Weapon")
&& (Helper.IsNumeric(card.Id.ElementAt(card.Id.Length - 1)) || card.Id == "AT_063t")
&& Helper.IsNumeric(card.Id.ElementAt(card.Id.Length - 2))
&& !CardIds.InvalidCardIds.Any(id => card.Id.Contains(id));
}
示例12: IsActualCard
public static bool IsActualCard(Card card) => Database.IsActualCard(card);
示例13: Clone
public object Clone()
{
var newcard = new Card(Id, PlayerClass, Rarity, Type, Name, Cost, LocalizedName, InHandCount, Count, Text, Attack, Health,
Race, Mechanics, Durability);
return newcard;
}
示例14: EqualsWithCount
public bool EqualsWithCount(Card card)
{
return card.Id == Id && card.Count == Count;
}
示例15: AddCardToDeck
///<summary>
/// Returns -1 if Hearthstone loses focus
/// </summary>
public static async Task<int> AddCardToDeck(Card card, ExportingInfo info)
{
if(!User32.IsHearthstoneInForeground())
{
Core.MainWindow.ShowMessage("Exporting aborted", "Hearthstone window lost focus.").Forget();
Logger.WriteLine("Exporting aborted, window lost focus", "DeckExporter");
return -1;
}
if(Config.Instance.ExportForceClear)
await ClearSearchBox(info.HsHandle, info.SearchBoxPos);
await ClickOnPoint(info.HsHandle, info.SearchBoxPos);
if(Config.Instance.ExportPasteClipboard)
{
Clipboard.SetText(GetSearchString(card));
SendKeys.SendWait("^v");
}
else
SendKeys.SendWait(GetSearchString(card));
SendKeys.SendWait("{ENTER}");
Logger.WriteLine("try to export card: " + card, "DeckExporter");
await Task.Delay(Config.Instance.DeckExportDelay * 2);
if(await CheckForSpecialCases(card, info.CardPosX + 50, info.Card2PosX + 50, info.CardPosY + 50, info.HsHandle))
return 0;
//Check if Card exist in collection
if(CardExists(info.HsHandle, (int)info.CardPosX, (int)info.CardPosY, info.HsRect.Width, info.HsRect.Height))
{
//Check if a golden exist
if(Config.Instance.PrioritizeGolden
&& CardExists(info.HsHandle, (int)info.Card2PosX, (int)info.CardPosY, info.HsRect.Width, info.HsRect.Height))
{
await ClickOnPoint(info.HsHandle, new Point((int)info.Card2PosX + 50, (int)info.CardPosY + 50));
if(card.Count == 2)
{
await ClickOnPoint(info.HsHandle, new Point((int)info.Card2PosX + 50, (int)info.CardPosY + 50));
await ClickOnPoint(info.HsHandle, new Point((int)info.CardPosX + 50, (int)info.CardPosY + 50));
}
}
else
{
await ClickOnPoint(info.HsHandle, new Point((int)info.CardPosX + 50, (int)info.CardPosY + 50));
if(card.Count == 2)
{
//Check if two card are not available
await Task.Delay(200 - Config.Instance.DeckExportDelay);
if(CardHasLock(info.HsHandle, (int)(info.CardPosX + info.HsRect.Width * 0.048),
(int)(info.CardPosY + info.HsRect.Height * 0.287), info.HsRect.Width, info.HsRect.Height))
{
if(CardExists(info.HsHandle, (int)info.Card2PosX, (int)info.CardPosY, info.HsRect.Width, info.HsRect.Height))
{
await ClickOnPoint(info.HsHandle, new Point((int)info.Card2PosX + 50, (int)info.CardPosY + 50));
return 0;
}
Logger.WriteLine("Only one copy found: " + card.Name, "DeckExporter");
return 1;
}
await ClickOnPoint(info.HsHandle, new Point((int)info.CardPosX + 50, (int)info.CardPosY + 50));
}
}
}
else
return card.Count;
return 0;
}