c++

C++ code posted by ss
created at 01 May 11:18

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

  CSupportAmmunition *v_pAmmo = NULL;
  CPacket::TStringVector* v_ammoVector = NULL;

  std::map<int, CSupportAmmunition*>::iterator iter;
  int v_nAuthQua = 0;
  char *v_nAmmoName;
  char v_cTmp[__NAMESIZE_MAX];
  string v_strTmp;

  CSupports *v_pSupports = m_TargetCraft->getSupports();
  std::map<int, CSupportAmmunition*> v_mapSupport =
      v_pSupports->getAmmunition();

  for (iter = v_mapSupport.begin(); iter != v_mapSupport.end(); iter++)
  {
    // 벡터 생성
    v_ammoVector = new CPacket::TStringVector;
    // 군수정보 가져오기
    v_pAmmo = iter->second;
    // 탄약명
    v_strTmp = v_pAmmo->getLogisticsName();
    v_nAmmoName = (char*)(v_strTmp.c_str());
    // 탄약수량
    v_nAuthQua = v_pAmmo->GetAuthQua();
    sprintf(v_cTmp, "%d", v_nAuthQua);
    // 그룻에 담기
        memset(v_cTmp, 0x00, __NAMESIZE_MAX);
        snprintf(v_cTmp, __NAMESIZE_MAX, "%d", (*iter).first );
        v_ammoVector->push_back(v_cTmp);

        memset(v_cTmp, 0x00, __NAMESIZE_MAX);
        snprintf(v_cTmp, __NAMESIZE_MAX, "%d", v_nAuthQua);
        v_ammoVector->push_back(v_cTmp);

        memset(v_cTmp, 0x00, __NAMESIZE_MAX);
        snprintf(v_cTmp, __NAMESIZE_MAX, "%s", v_nAmmoName);
        v_ammoVector->push_back(v_cTmp);
        // 벡터 추가
        m_DamageAmmo.push_back(v_ammoVector);
  }
1.31 KB in 3 ms with coderay