#ifndef _CARD_HPP_
#define _CARD_HPP_
#include <thread>
#include <ev++.h>
#include "card_base.h"
#include "write-copy.h"

struct card_list_visit:visitor<std::shared_ptr<card_location_base>>
{
	bool visit(std::shared_ptr<card_location_base> c);
};

struct card_list:single_base<card_list,uint64_t,std::shared_ptr<card_location_base>>
{
    ///id64=-1为初始化所有卡, id格式为：10000001016
    void init_staffer(int64_t id64);
    void init_vehicle(int64_t id64);
    void on_message(zloop<task*> *loop,const message_locinfo&loc,bool is_history);
    void init_card_from_db();

    void load_his_card_postion_vehicle();
    void load_his_card_postion_staff();
    void load_his_card_postion_from_db();

    ~card_list(){}
};
#endif
