/// <summary> /// /// Tries to get the card list for a given dictionary key. Generic so that the key can be suited for any of the constructed dictionaries /// /// </summary> public List <CardData> GetDictionaryList <T>(T key, CardFilter listFilter = null) { var dictionaryList = new List <CardData>(); var type = typeof(T); switch (type) { case Type _ when type == typeof(Tags): TagLookup.TryGetValue((Tags)(object)key, out dictionaryList); break; case Type _ when type == typeof(Synergies): SynergyLookup.TryGetValue((Synergies)(object)key, out dictionaryList); break; case Type _ when type == typeof(Classes.ClassList): ClassLookup.TryGetValue((Classes.ClassList)(object) key, out dictionaryList); break; case Type _ when type == typeof(ClassResources): ClassPlayableLookup.TryGetValue((ClassResources)(object)key, out dictionaryList); break; case Type _ when type == typeof(CardResources): ResourceLookup.TryGetValue((CardResources)(object)key, out dictionaryList); break; case Type _ when type == typeof(Sets): SetLookup.TryGetValue((Sets)(object)key, out dictionaryList); break; case Type _ when type == typeof(Rarity): RarityLookup.TryGetValue((Rarity)(object)key, out dictionaryList); break; case Type _ when type == typeof(CardTypes): TypeLookup.TryGetValue((CardTypes)(object)key, out dictionaryList); break; default: throw new Exception("Not a valid Dictionary Type"); } if (dictionaryList != null) { if (listFilter != null) { return(FilterCardList(dictionaryList.OrderCardList(), listFilter)); } else { return(dictionaryList.OrderCardList()); } } else { return(new List <CardData>()); } }
public void Start() { lookup = ClassLookup.getClassLookup(); image = imageObj.GetComponent <Image>(); className = classNameObj.GetComponent <Text>(); attack = attackObj.GetComponent <Text>(); defense = defenseObj.GetComponent <Text>(); cost = costObj.GetComponent <Text>(); description = descriptionObj.GetComponent <Text>(); }
public void Awake() { classinfo = this; if (texKey.Count == texVal.Count) { for (int i = 0; i < texKey.Count; i++) { textures.Add(texKey[i], texVal[i]); } } }
private void ConvertClassField(XmlElement xmlData) { ClassLookup lookup = Context.Extensions[ClassLookup.Name] as ClassLookup; foreach (XmlElement each in xmlData.SelectNodes("Course")) { string className = each.SelectSingleNode("ClassName").InnerText; XmlElement classNode = CreateChild(each, "ClassID"); classNode.InnerText = lookup.GetClassID(className); } }
public TdlClass AddClass(string identifier) { if (identifier == "") { return(null); } TdlClass tdlClass = new TdlClass(identifier, this); _Classes.Add(tdlClass); ClassIdentifierLookup.Add(identifier, tdlClass); ClassLookup.Add(tdlClass.ObjectId, tdlClass); Root.AddClass(tdlClass); return(tdlClass); }
public void InitFromXMLNode(System.Xml.XmlElement XmlNode) { _skip_empty = bool.Parse(XmlNode.GetAttribute("SkipEmpty")); _activate_validator = false; foreach (XmlElement each in XmlNode.SelectNodes("ActivatorField")) { string fieldName = each.InnerText; _activate_validator |= (_context.SelectedFields.Contains(fieldName)); } if (!_activate_validator) { return; } _lookup = _context.Extensions[ClassLookup.Name] as ClassLookup; }
public void Awake() { classinfo = this; texture = new Texture[2]; if (p1TexKey.Count == p1TexVal.Count) { for (int i = 0; i < p1TexKey.Count; i++) { p1Textures.Add(p1TexKey[i], p1TexVal[i]); } } if (p2TexKey.Count == p2TexVal.Count) { for (int i = 0; i < p2TexKey.Count; i++) { p2Textures.Add(p2TexKey[i], p2TexVal[i]); } } }
public void Start() { classInfo = ClassLookup.getClassLookup(); driver = GameDriver.getGameDriverRef(); textureButtons(1); }
public void Start() { classInfo = ClassLookup.getClassLookup(); }
public bool HasClass(uint objectId) { return(ClassLookup.ContainsKey(objectId)); }