Files
2022-10-26 12:25:11 +08:00

110 lines
2.9 KiB
C++

#pragma once
#include "Excel.h"
#include "def.h"
#include "BasicInfo.h"
#include "SkillInfo.h"
#include "StatusInfo.h"
#include "Monster.h"
#include "Item.h"
#include <vector>
using namespace std;
const int MAX_SCRIPT_TYPE = 10;
enum eSCRIPT_TYPE
{
SCRIPT_SKILL = 0,
SCRIPT_STATE,
SCRIPT_MONSTER,
SCRIPT_ITEM_WEAPON,
SCRIPT_ITEM_ARMOR,
SCRIPT_ITEM_ACCESSARY,
SCRIPT_ITEM_WASTE,
};
class CExcelManager
{
public:
CExcelManager(void);
~CExcelManager(void);
private:
//Excel declare
CApplication m_app;
CWorkbooks m_books;
CWorkbook m_book;
CWorksheets m_sheets;
CWorksheet m_sheet;
CRange m_range;
//data
int m_nNumSheet;
int m_nScriptType; //현재 vector에 저장된 데이터의 Type, SheetInfo의 타입은 미리 저장된 타입이다.
public:
BOOL InitExcel(CString strName);
CString GetValue(CString strCell);
void asctoa(int nCode, char* szBuf);
int GetXLColNumFromString(CString strRow);
CString GetXLColNumFromInt(int nIdx);
BOOL SaveData(CScript* pData, int nCol, COleVariant value, int& nErrorCode);
CString GetErrorDescription(int nError);
BOOL LoadSheetData(void);
BOOL SaveText(CString& strText);
void DeleteAllItem(void);
vector<CString> GetTitle();
int GetRowCount();
int GetColCount();
void SetSttCol(CString strSttCol);
void SetEndCol(CString strEndCol);
void SetSttRow(int nSttRow);
void SetEndRow(int nEndRow);
CString GetSttCol();
CString GetEndCol();
int GetSttRow();
int GetEndRow();
int GetSheetNo();
void SetScriptType( int nScriptType ) {m_nScriptType = nScriptType;}
int GetScriptType(void);
//SheetInfo
public:
BOOL LoadSheetInfo();
BOOL SaveSheetInfo( int nType, CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
private:
BOOL GetSkillSheetInfo();
BOOL GetStateSheetInfo();
BOOL GetMonsterSheetInfo();
BOOL GetWeaponSheetInfo();
BOOL GetArmorSheetInfo();
BOOL GetAccessarySheetInfo();
BOOL GetWasteSheetInfo();
BOOL SetSkillSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetStateSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetMonsterSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetWeaponSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetArmorSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetAccessarySheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
BOOL SetWasteSheetInfo( CString strSttCol, CString strEndCol, int nSttRow, int nEndRow, int nSheetNo );
public:
CSheetInfo m_sheetInfo[MAX_SCRIPT_TYPE];
vector<CScript*> m_vecData;
CString m_strError;
CString m_strText;
int m_nColCount; // 현재 스크립트의 선택된 컬럼의 개수
};