2019-09-08 16:42:10 +00:00
# pragma once
# include <string>
# include <iostream>
2019-11-05 19:39:33 +00:00
# include <ctime>
2019-09-08 16:42:10 +00:00
2023-08-29 22:35:38 +00:00
# include "common.h"
2019-09-11 17:48:03 +00:00
// enum Service {
// gc,
// ocpl,
// ocde,
// ocna,
// ocro,
// ocuk,
// ocnl,
// gcsu
// };
2019-09-08 16:42:10 +00:00
// 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
// };
2020-03-06 09:55:57 +00:00
enum Status {
ok , // available
disabled , // temporarily disabled
archived , // archived
unknown
} ;
2019-09-08 16:42:10 +00:00
class Cache {
public :
std : : string code ;
2022-07-13 16:30:26 +00:00
uint internal_id ;
2019-09-08 16:42:10 +00:00
Position pos ;
std : : string name ;
2020-03-06 09:55:57 +00:00
Status status ;
2019-09-08 16:42:10 +00:00
std : : string size ;
2019-10-21 13:10:18 +00:00
float diff = 0 ;
float terr = 0 ;
2022-07-13 16:30:26 +00:00
uint fav = 0 ;
uint founds = 0 ;
2020-08-28 15:38:28 +00:00
float rating = 0 ;
2020-02-29 01:14:31 +00:00
bool recommended = 0 ; // was the cache recommended by that user?
2019-09-08 16:42:10 +00:00
std : : string type ;
2021-09-05 17:44:44 +00:00
std : : string country ;
2019-09-12 11:58:54 +00:00
std : : string region ;
2020-04-03 00:23:16 +00:00
std : : string subregion ;
2019-09-11 17:48:03 +00:00
std : : string origin ;
std : : string owner ;
std : : string owner_uuid ;
2020-07-05 21:30:51 +00:00
std : : time_t date_t = 0 ;
std : : time_t date_hidden_t = 0 ;
2019-11-09 13:37:48 +00:00
std : : tm date_tm ;
2020-01-25 14:26:14 +00:00
std : : tm date_hidden_tm ;
2020-03-20 02:28:20 +00:00
std : : string year_month ;
2019-11-07 16:25:17 +00:00
std : : string year ;
std : : string mon ;
std : : string day ;
std : : string hour ;
2019-11-17 18:42:32 +00:00
std : : string day_of_week ;
2019-11-09 13:37:48 +00:00
std : : string date ;
2020-01-25 14:26:14 +00:00
std : : string date_hidden ;
2020-07-06 11:57:51 +00:00
int age_when_found = - 1 ;
2020-09-06 17:44:34 +00:00
int age_now = - 1 ;
2022-07-13 16:30:26 +00:00
uint trail = 0 ;
2022-07-12 23:11:44 +00:00
bool ftf = 0 ;
2019-11-09 13:37:48 +00:00
2020-01-25 14:26:14 +00:00
void set_date ( const std : : tm & t ) ;
void set_date_hidden ( const std : : tm & t ) ;
2019-09-08 16:42:10 +00:00
static Position home ;
void show ( ) const ;
2019-11-04 20:13:20 +00:00
std : : string link ( ) const ;
2020-02-29 01:26:43 +00:00
std : : string link_name ( ) const ;
2020-01-28 05:13:11 +00:00
std : : string safe_name ( ) const ;
2023-08-30 13:53:47 +00:00
// float distance() const;
2019-09-08 16:42:10 +00:00
} ;