public int Check(Banlist ban, bool ocg, bool tcg) { if (Main.Count < 40 || Main.Count > 60 || Extra.Count > 15 || Side.Count > 15) return 1; IDictionary<int, int> cards = new Dictionary<int, int>(); IList<int>[] stacks = { Main, Extra, Side }; foreach (IList<int> stack in stacks) { foreach (int id in stack) { Card card = Card.Get(id); AddToCards(cards, card); if (!ocg && card.Ot == 1 || !tcg && card.Ot == 2) return id; } } if (ban == null) return 0; foreach (var pair in cards) { int max = ban.GetQuantity(pair.Key); if (pair.Value > max) return pair.Key; } return 0; }
void Update() { if (loadedPicCode != cardData.Id) { Texture2D pic = GameTextureManager.get(cardData.Id, GameTextureType.card_picture); if (pic != null) { loadedPicCode = cardData.Id; gameObject.transform.FindChild("face").GetComponent <Renderer>().material.mainTexture = pic; } } if (Program.I().deckManager.currentBanlist != loaded_banlist) { ban_icon ico = GetComponentInChildren <ban_icon>(); loaded_banlist = Program.I().deckManager.currentBanlist; if (loaded_banlist != null) { ico.show(loaded_banlist.GetQuantity(cardData.Id)); } else { ico.show(3); } } if (isDraging) { gameObject.transform.position += (getGoodPosition(4) - gameObject.transform.position) * 0.3f; } if (Vector3.Distance(Vector3.zero, gameObject.transform.position) > 50 && bool_physicalON) { killIt(); } }
void Update() { if (Program.I().deckManager != null) { if (loaded_code != code) { Texture2D t = GameTextureManager.get(code, GameTextureType.card_picture, defaults); if (t != null) { uiTexture.mainTexture = t; uiTexture.aspectRatio = ((float)t.width) / ((float)t.height); uiTexture.forceWidth((int)(uiTexture.height * uiTexture.aspectRatio)); loaded_code = code; loaded_banlist = null; } } if (loaded_banlist != Program.I().deckManager.currentBanlist) { loaded_banlist = Program.I().deckManager.currentBanlist; if (ico != null) { if (loaded_banlist == null) { ico.show(3); return; } ico.show(loaded_banlist.GetQuantity(code)); } } } }
void Update() { if (coli != null) { if (Program.InputGetMouseButtonDown_0) { if (Program.pointedCollider == coli) { ((CardDescription)(Program.I().cardDescription)).setData(YGOSharp.CardsManager.Get(code), GameTextureManager.myBack, "", true); } } } if (Program.I().deckManager != null) { if (loaded_code != code) { Texture2D t = GameTextureManager.get(code, GameTextureType.card_picture, defaults); if (t != null) { uiTexture.mainTexture = t; uiTexture.aspectRatio = ((float)t.width) / ((float)t.height); uiTexture.forceWidth((int)(uiTexture.height * uiTexture.aspectRatio)); loaded_code = code; loaded_banlist = null; } } if (loaded_banlist != Program.I().deckManager.currentBanlist) { loaded_banlist = Program.I().deckManager.currentBanlist; if (ico != null) { if (loaded_banlist == null) { ico.show(3); return; } ico.show(loaded_banlist.GetQuantity(code)); } if (ico_ot != null) { //[1: OCG]、[2: TCG]、[3: OCG&TCG]、[4: Anime] if (data.Ot == 2 || data.Ot == 4) { ico_ot.show(data.Ot); return; } ico_ot.show(3); } } } }
public int Check(Banlist ban, bool ocg, bool tcg) { if (Main.Count < 40 || Main.Count > 60 || Extra.Count > 15 || Side.Count > 15) { return(1); } IDictionary <int, int> cards = new Dictionary <int, int>(); IList <int>[] stacks = { Main, Extra, Side }; foreach (IList <int> stack in stacks) { foreach (int id in stack) { Card card = Card.Get(id); AddToCards(cards, card); if (!ocg && card.Ot == 1 || !tcg && card.Ot == 2) { return(id); } if (card.HasType(CardType.Token)) { return(id); } } } if (ban == null) { return(0); } foreach (var pair in cards) { int max = ban.GetQuantity(pair.Key); if (pair.Value > max) { return(pair.Key); } } return(0); }
public int Check(Banlist ban, bool ocg, bool tcg) { if (Main.Count < Config.GetInt("MainDeckMinSize", 40) || Main.Count > Config.GetInt("MainDeckMaxSize", 60) || Extra.Count > Config.GetInt("ExtraDeckMaxSize", 15) || Side.Count > Config.GetInt("SideDeckMaxSize", 15)) { return(1); } IDictionary <int, int> cards = new Dictionary <int, int>(); IList <int>[] stacks = { Main, Extra, Side }; foreach (IList <int> stack in stacks) { foreach (int id in stack) { Card card = Card.Get(id); AddToCards(cards, card); if (!ocg && card.Ot == 1 || !tcg && card.Ot == 2) { return(id); } } } if (ban == null) { return(0); } foreach (var pair in cards) { int max = ban.GetQuantity(pair.Key); if (pair.Value > max) { return(pair.Key); } } return(0); }
internal static List <Card> searchAdvanced( string getName, int getLevel, int getAttack, int getDefence, int getP, int getYear, int getLevel_UP, int getAttack_UP, int getDefence_UP, int getP_UP, int getYear_UP, int getOT, string getPack, int getBAN, Banlist banlist, uint getTypeFilter, uint getRaceFilter, uint getAttributeFilter, uint getCatagoryFilter ) { List <Card> returnValue = new List <Card>(); foreach (var item in _cards) { Card card = item.Value; if ((card.Type & (uint)CardType.Token) == 0) { if (getName == "" || Regex.Replace(card.Name, getName, "miaowu", RegexOptions.IgnoreCase) != card.Name || Regex.Replace(card.Desc, getName, "miaowu", RegexOptions.IgnoreCase) != card.Desc || Regex.Replace(card.strSetName, getName, "miaowu", RegexOptions.IgnoreCase) != card.strSetName || card.Id.ToString() == getName ) { if (((card.Type & getTypeFilter)) == getTypeFilter || getTypeFilter == 0) { if ((card.Race & getRaceFilter) > 0 || getRaceFilter == 0) { if ((card.Attribute & getAttributeFilter) > 0 || getAttributeFilter == 0) { if (((card.Category & getCatagoryFilter)) == getCatagoryFilter || getCatagoryFilter == 0) { if (judgeint(getAttack, getAttack_UP, card.Attack)) { if (judgeint(getDefence, getDefence_UP, card.Defense)) { if (judgeint(getLevel, getLevel_UP, card.Level)) { if (judgeint(getP, getP_UP, card.LScale)) { if (judgeint(getYear, getYear_UP, card.year)) { if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN) { if (getOT == 0 || getOT == card.Ot) { if (getPack == "" || card.packFullName == getPack) { returnValue.Add(card); } } } } } } } } } } } } } } } nameInSearch = getName; returnValue.Sort(comparisonOfCard()); nameInSearch = ""; return(returnValue); }
internal static List <Card> searchAdvanced( string getName, int getLevel, int getAttack, int getDefence, int getP, int getYear, int getLevel_UP, int getAttack_UP, int getDefence_UP, int getP_UP, int getYear_UP, string getPack, int getBAN, Banlist banlist, uint getTypeFilter, uint getRaceFilter, uint getAttributeFilter, uint getCatagoryFilter ) { List <Card> returnValue = new List <Card>(); var temp = getTypeFilter; if (temp >= 0x8000000) { getTypeFilter -= 0x8000000; } foreach (var item in _cards) { Card card = item.Value; if (card.Id >= 800000000 || card.Id <= 70 || card.Id == 420 || card.Id == 500 || card.Id == 55555 || card.Id == 19558409 || card.Id == 26630260) { continue; } if ((card.Type & (uint)CardType.Token) == 0) { if (getName == "" || Regex.Replace(card.Name, getName, "miaowu", RegexOptions.IgnoreCase) != card.Name || Regex.Replace(card.Desc, getName, "miaowu", RegexOptions.IgnoreCase) != card.Desc || Regex.Replace(card.strSetName, getName, "miaowu", RegexOptions.IgnoreCase) != card.strSetName || card.Id.ToString() == getName ) { bool[] BolleanArrayOfCardType = card.Type.ToBooleanArray(); if ((temp >= 0x8000000 && ((BolleanArrayOfCardType.Count() >= 6 && !BolleanArrayOfCardType[BolleanArrayOfCardType.Count() - 6]) || BolleanArrayOfCardType.Count() < 6)) || temp <= 0x8000000) { if ((card.Type & getTypeFilter) == getTypeFilter || getTypeFilter == 0) { if ((card.Race & getRaceFilter) > 0 || getRaceFilter == 0) { if ((card.Attribute & getAttributeFilter) > 0 || getAttributeFilter == 0) { if (((card.Category & getCatagoryFilter)) == getCatagoryFilter || getCatagoryFilter == 0) { if (judgeint(getAttack, getAttack_UP, card.Attack)) { if (judgeint(getDefence, getDefence_UP, card.Defense)) { if (judgeint(getLevel, getLevel_UP, card.Level)) { if (judgeint(getP, getP_UP, card.LScale)) { if (judgeint(getYear, getYear_UP, card.year)) { if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN) { if (getPack == "" || card.packFullName == getPack) { returnValue.Add(card); } } } } } } } } } } } } } } } nameInSearch = getName; returnValue.Sort(comparisonOfCard()); nameInSearch = ""; return(returnValue); }