70 lines
1.5 KiB
C++
70 lines
1.5 KiB
C++
#pragma once
|
|
#include<map>
|
|
#include<string>
|
|
#include<iostream>
|
|
#include"datadef.h"
|
|
#include<math.h>
|
|
|
|
|
|
class CDBLoader
|
|
{
|
|
public:
|
|
CDBLoader(void);
|
|
~CDBLoader(void);
|
|
public:
|
|
// 战机性能参数表
|
|
std::map<std::string, ABILITY*> FighterDataList;
|
|
|
|
// 战船性能参数表
|
|
std::map<std::string, ABILITY*> ShipDataList;
|
|
|
|
// 防空系统性能参数表
|
|
std::map<std::string, ABILITY*> AirDefenseDataList;
|
|
|
|
// 地面目标性能参数表
|
|
std::map<std::string, ABILITY*> GroundTargetDataList;
|
|
|
|
static CDBLoader * Instance();
|
|
|
|
//static void Release();
|
|
|
|
// 从数据库种读取战机性能参数
|
|
void readFighterDB();
|
|
|
|
// 从数据库中读取战船性能参数
|
|
void readShipDB();
|
|
|
|
// 从数据库种读取防空系统性能参数
|
|
void readAirDefenseDB();
|
|
|
|
// 从数据库种读取地面目标性能参数
|
|
void readGroundTargetDB();
|
|
|
|
// 读取所有数据库
|
|
void readALLDB();
|
|
|
|
//返回指定型号的战机性能参数
|
|
ABILITY* GetFighterDBRecord(std::string & strModel);
|
|
|
|
//返回战机性能参数链表
|
|
std::map<std::string, ABILITY*>& GetFighterDBRecordList();
|
|
|
|
//返回指定型号的战船性能参数
|
|
ABILITY* GetShipDBRecord(std::string & strModel);
|
|
|
|
//返回战船性能参数链表
|
|
std::map<std::string, ABILITY*>& GetShipDBRecordList();
|
|
|
|
//返回指定型号的防空系统性能参数
|
|
ABILITY* GetAirDefenseDBRecord(std::string & strModel);
|
|
|
|
//返回防空系统性能参数链表
|
|
std::map<std::string, ABILITY*>& GetAirDefenseDBRecordList();
|
|
|
|
//返回指定型号的地面目标性能参数
|
|
ABILITY* GetGroundTargetDBRecord(std::string & strModel);
|
|
|
|
//返回地面目标性能参数链表
|
|
std::map<std::string, ABILITY*>& GetGroundTargetDBRecordList();
|
|
};
|