Exemplo n.º 1
0
        public Feature feature(string varName, IList <Feature> from = null)
        {
            Feature offs;
            Func <Feature, bool> search = ss => string.Equals(ss.name, varName, StringComparison.OrdinalIgnoreCase);

            if (from == null)
            {
                offs = FeaturesResources.FirstOrDefault(search) ?? FeaturesCountry.FirstOrDefault(search) ??
                       FeaturesWarfare.FirstOrDefault(search) ?? FeaturesSpecial.FirstOrDefault(search);
            }
            else
            {
                offs = from.First(search);
            }
            return(offs);
            // if(from == null)
            //     offs = FeaturesResources
            //         .Concat(FeaturesCountry)
            //         .Concat(FeaturesWarfare)
            //         .Concat(FeaturesSpecial)
            //         .First(ss => ss.name.ToLower() == varName.ToLower());
            // else
            //     offs = from.First(ss => ss.name.ToLower() == varName.ToLower());
            // return offs;
        }
Exemplo n.º 2
0
        public string pointerStore(string varName)
        {
            Feature offs;
            Func <Feature, bool> search = ss => string.Equals(ss.name, varName, StringComparison.OrdinalIgnoreCase);

            offs = FeaturesResources.FirstOrDefault(search) ?? FeaturesCountry.FirstOrDefault(search) ??
                   FeaturesWarfare.FirstOrDefault(search) ?? FeaturesSpecial.FirstOrDefault(search);
            var p      = DataPointer.First(s => s.id == offs.pointerId).pointer;
            var offset = String.IsNullOrEmpty(offs.offset) ? "" : "," + offs.offset;

            return(DataGame.ProcessName + "+" + p + offset);
            // Feature offs;
            // offs = FeaturesResources
            //    .Concat(FeaturesCountry)
            //    .Concat(FeaturesWarfare)
            //    .Concat(FeaturesSpecial)
            //    .First(ss => ss.name == varName);
            //
            // var p = DataPointer.First(s =>
            //     s.id == offs.pointerId).pointer;
            // var offset = String.IsNullOrEmpty(offs.offset) ? "" : "," + offs.offset;
            //
            // return DataGame.ProcessName + "+" + p + offset;
        }