예제 #1
0
        public override bool ToBeDisplayed(Geocache cache)
        {
            // si _bEasyTradiOnly
            // On ne garde que les caches tradi dont les D et T sont <= 4 NON TROUVEES !!!
            // Found it
            if (cache.IsFound())
            {
                return(false);
            }

            // Une tradi ?
            if (String.Compare(cache._Type, "Traditional Cache", true) != 0)
            {
                return(false);
            }

            // D
            if (cache.getD() >= 4)
            {
                return(false);
            }

            // T
            if (cache.getT() >= 4)
            {
                return(false);
            }

            // Et les logs
            if (_bForgetAboutLogs)
            {
                // On se moque des logs pour l'instant
                return(true);
            }
            else
            {
                if (cache._Logs.Count != 0)
                {
                    if (cache._Logs[0]._Type == "Found it")
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                return(false);
            }
        }
예제 #2
0
        private bool CheckCacheContent(Geocache geo)
        {
            bool ok = true;

            ok = ok && CheckOneEntry("Cache update", "Owner", (geo._Owner == "T Diddy and Sea Mama"));
            ok = ok && CheckOneEntry("Cache update", "Type", (geo._Type == "Traditional Cache"));
            ok = ok && CheckOneEntry("Cache update", "Date of creation", (geo._DateCreation == "2006-07-05T00:00:1Z"));
            ok = ok && CheckOneEntry("Cache update", "Description (short)", (geo._ShortDescription != ""));
            ok = ok && CheckOneEntry("Cache update", "Description (long)", (geo._LongDescription != ""));
            ok = ok && CheckOneEntry("Cache update", "Difficulty", (geo._D == "3"));
            ok = ok && CheckOneEntry("Cache update", "Terrain", (geo._T == "1"));
            ok = ok && CheckOneEntry("Cache update", "Latitude", (geo._Latitude == "37.787767"));
            ok = ok && CheckOneEntry("Cache update", "Longitude", (geo._Longitude == "-122.489883"));
            ok = ok && CheckOneEntry("Cache update", "Container", (geo._Container == "Micro"));
            ok = ok && CheckOneEntry("Cache update", "Hint", (geo._Hint != ""));
            ok = ok && CheckOneEntry("Cache update", "Logs", (geo._Logs.Count != 0));
            String username = ConfigurationManager.AppSettings["owner"];

            ok = ok && CheckOneEntry("Cache update", "Found: " + geo.IsFound().ToString(), true);
            ok = ok && CheckOneEntry("Cache update", "Owned", (geo._bOwned == false));
            ok = ok && CheckOneEntry("Cache update", "Archived", (geo._Archived == "False"));
            ok = ok && CheckOneEntry("Cache update", "Available", (geo._Available == "True"));
            ok = ok && CheckOneEntry("Cache update", "Owner", (geo._PlacedBy == "T Diddy and Sea Mama"));
            ok = ok && CheckOneEntry("Cache update", "Country", (geo._Country == "United States"));
            ok = ok && CheckOneEntry("Cache update", "State", (geo._State == "California"));
            if (geo._Ocd != null)
            {
                ok = ok && CheckOneEntry("Cache update", "Statistics", (geo._Ocd._iNbFavs != 0));
                ok = ok && CheckOneEntry("Cache update", "Popularity", (geo._Ocd._dRatingSimple != -1.0));
            }
            else
            {
                CreateEntry("KO", "Cache update", "Statistics");
                ok = false;
            }
            return(ok);
        }