kopia lustrzana https://gitlab.com/tomaszg/geostat
66 wiersze
1.5 KiB
C++
66 wiersze
1.5 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <set>
|
|
#include <iostream>
|
|
|
|
enum Service {
|
|
gc,
|
|
ocpl,
|
|
ocde,
|
|
ocna,
|
|
ocro,
|
|
ocuk,
|
|
ocnl,
|
|
gcsu
|
|
};
|
|
|
|
// enum Type {
|
|
// traditional,
|
|
// multi,
|
|
// quiz, // also known as "Mystery"
|
|
// moving, // a geocache with changing coordinates
|
|
// virt,
|
|
// webcam,
|
|
// other, // also dubbed "unknown type"; allows OC users to create special caches which don't fit into the scheme of well-known types
|
|
// event, // a peculiar type of geocache which is NOT a geocache at all, but it is stored as a geocache in OC database. Just keep in mind, that in case of Event Caches, some fields may have a little different meaning than you would tell by their name
|
|
// own, // a moving geocache which is carried by the owner
|
|
// podcast //a geocache with attached MP3 file(s). The MP3 data is not accessible via OKAPI. This type is only in use at Opencaching.US
|
|
// };
|
|
|
|
class Position {
|
|
public:
|
|
float lat;
|
|
float lon;
|
|
};
|
|
|
|
class Cache {
|
|
public:
|
|
std::string code;
|
|
Position pos;
|
|
std::string name;
|
|
std::string size;
|
|
float diff;
|
|
float terr;
|
|
std::string type;
|
|
Service origin;
|
|
|
|
static Position home;
|
|
|
|
void show() const;
|
|
float distance() const;
|
|
};
|
|
|
|
class CacheCmp {
|
|
public:
|
|
bool operator()(const Cache& lhs, const Cache& rhs) const {
|
|
return lhs.code < rhs.code;
|
|
}
|
|
};
|
|
|
|
bool CacheCmpNS(const Cache& lhs, const Cache& rhs);
|
|
bool CacheCmpEW(const Cache& lhs, const Cache& rhs);
|
|
bool CacheCmpDist(const Cache& lhs, const Cache& rhs);
|
|
|
|
typedef std::set<Cache, CacheCmp> Caches;
|