Jump to content
Ximboliex

How to increase the reading of arguments?

Recommended Posts

Hi Comunity🤗,

 

I have a small problem, I want to add 1 or more rows to a file as they did with stoneinfo.txt in CO files with the RGB column, in this case it would be Characterposeinfo.txt which consists of 7 arguments which are

Fists Sword 2H Sword Dual Swords Firegun Bow Dagger

 My knowledge is not enough that's why I come to ask for help, the file I modified was Characterposet.h 

This Characterposet.h is a original

#pragma once

#include "TableData.h"

class CPoseInfo : public CRawDataInfo
{
  public:
  CPoseInfo()
  {
	for(int i = 0; i < 7; i++)
	  sRealPoseID[i] = 0;
  }
  short sRealPoseID[7]; // 5�ֶ�������, ����, ��������, ˫������, ����.....
};

class CPoseSet : public CRawDataSet
{
  public:
  static CPoseSet* I() { return _Instance; }

  CPoseSet(int nIDStart, int nIDCnt) :
	  CRawDataSet(nIDStart, nIDCnt)
  {
	_Instance = this;
	_Init();
  }

  protected:
  static CPoseSet* _Instance; // �൱�ڵ���, ���Լ���ס

  virtual CRawDataInfo* _CreateRawDataArray(int nCnt)
  {
	return new CPoseInfo[nCnt];
  }

  virtual void _DeleteRawDataArray()
  {
	delete[](CPoseInfo*) _RawDataArray;
  }

  virtual int _GetRawDataInfoSize()
  {
	return sizeof(CPoseInfo);
  }

  virtual void* _CreateNewRawData(CRawDataInfo* pInfo)
  {
	return NULL;
  }

  virtual void _DeleteRawData(CRawDataInfo* pInfo)
  {
	//SAFE_DELETE(pInfo->pData);
  }

  virtual BOOL _ReadRawDataInfo(CRawDataInfo* pRawDataInfo, vector<string>& ParamList)
  {
	if(ParamList.size() == 0) return FALSE;

	CPoseInfo* pInfo = (CPoseInfo*)pRawDataInfo;

	pInfo->sRealPoseID[0] = (short)Str2Int(ParamList[0]);
	pInfo->sRealPoseID[1] = (short)Str2Int(ParamList[1]);
	pInfo->sRealPoseID[2] = (short)Str2Int(ParamList[2]);
	pInfo->sRealPoseID[3] = (short)Str2Int(ParamList[3]);
	pInfo->sRealPoseID[4] = (short)Str2Int(ParamList[4]);
	pInfo->sRealPoseID[5] = (short)Str2Int(ParamList[5]);
	pInfo->sRealPoseID[6] = (short)Str2Int(ParamList[6]);

	//      LG("poseset", "Read Pose List [%d][%s]\n", pInfo->nID, pInfo->szDataName);

	return TRUE;
  }
};

inline CPoseInfo* GetPoseInfo(short sPoseID)
{
  return (CPoseInfo*)CPoseSet::I()->GetRawDataInfo(sPoseID);
}

inline short GetRealPoseID(short sPoseID, short sPoseType)
{
  CPoseInfo* pInfo = GetPoseInfo(sPoseID);
  return pInfo->sRealPoseID[sPoseType];
}

and this Characterposet.h is a edited

#pragma once

#include "TableData.h"


class CPoseInfo : public CRawDataInfo
{

public:

	CPoseInfo()
	{
        for(int i=0; i<9; i++)  sRealPoseID[i] = 0;
    }
    short sRealPoseID[9]; // 
};


class CPoseSet : public CRawDataSet
{

public:
	
	static CPoseSet* I() { return _Instance; }
	
	CPoseSet(int nIDStart, int nIDCnt)
	:CRawDataSet(nIDStart, nIDCnt)
	{
	    _Instance = this;
		_Init();
	}

protected:

	static CPoseSet* _Instance; // 相当于单键, 把自己记住
   
	virtual CRawDataInfo* _CreateRawDataArray(int nCnt)
	{
		return new CPoseInfo[nCnt];
	}
	
	virtual void _DeleteRawDataArray()
	{
		delete[] (CPoseInfo*)_RawDataArray;
	}
	
	virtual int _GetRawDataInfoSize()
	{
		return sizeof(CPoseInfo);
	}

	virtual void*	_CreateNewRawData(CRawDataInfo *pInfo)
	{
		return NULL;
	}

	virtual void  _DeleteRawData(CRawDataInfo *pInfo)
	{
		SAFE_DELETE(pInfo->pData);
	}
	
	virtual BOOL _ReadRawDataInfo(CRawDataInfo *pRawDataInfo, vector<string> &ParamList)
	{   
        if(ParamList.size()==0) return FALSE;
		
        CPoseInfo *pInfo = (CPoseInfo*)pRawDataInfo;
		
        pInfo->sRealPoseID[0] = (short)Str2Int(ParamList[0]);
        pInfo->sRealPoseID[1] = (short)Str2Int(ParamList[1]);
        pInfo->sRealPoseID[2] = (short)Str2Int(ParamList[2]);
        pInfo->sRealPoseID[3] = (short)Str2Int(ParamList[3]);
        pInfo->sRealPoseID[4] = (short)Str2Int(ParamList[4]);
        pInfo->sRealPoseID[5] = (short)Str2Int(ParamList[5]);
        pInfo->sRealPoseID[6] = (short)Str2Int(ParamList[6]);
		pInfo->sRealPoseID[7] = (short)Str2Int(ParamList[7]);
        pInfo->sRealPoseID[8] = (short)Str2Int(ParamList[8]);
        
        LG("poseset", "Read Pose List [%d][%s]\n", pInfo->nID, pInfo->szDataName);
            
        return TRUE;
    }
};

inline CPoseInfo* GetPoseInfo(short sPoseID)
{
	return (CPoseInfo*)CPoseSet::I()->GetRawDataInfo(sPoseID);
}

inline short GetRealPoseID(short sPoseID, short sPoseType)
{
    CPoseInfo *pInfo = GetPoseInfo(sPoseID);
    return pInfo->sRealPoseID[sPoseType];
}

but but when I compile it gives me a parameter error when adding another column (parameter) more, What else do I need to modify or is my modification incorrect?

compile error.png


xbx3.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...