コード例 #1
0
        public AvailablePart GetPartByName(string partName)
        {
            var p = AllCargoParts.Where(x => x.name == partName).FirstOrDefault();

            if (p != null)
            {
                return(p);
            }
            return(null);
        }
コード例 #2
0
        private void GetPartsForCategory(string catName)
        {
            var cParts = AllCargoParts
                         .Where(x => x.category.ToStringCached() == catName ||
                                (x.tags.ToLower().Contains("cck-" + catName)));

            catParts = new List <PartScrollbarData>();
            foreach (var p in cParts)
            {
                PartScrollbarData pd;
                pd.partName  = p.name;
                pd.partTitle = p.title;
                catParts.Add(pd);
            }
        }