public override bool ParseDataFromNDT(TsDataReader dr) { foreach (TsDataReader.Row data in dr) { BATTLE_CONSTANT bATTLE_CONSTANT = new BATTLE_CONSTANT(); bATTLE_CONSTANT.SetData(data); bATTLE_CONSTANT.m_eConstant = BATTLE_CONSTANT_Manager.GetInstance().GetConstantCode(bATTLE_CONSTANT.strConstant); this.SetData(bATTLE_CONSTANT.m_eConstant, bATTLE_CONSTANT.m_nConstant); } dr.BeginSection("[DEFENSE]"); foreach (TsDataReader.Row data2 in dr) { DEFENSE_DATA dEFENSE_DATA = new DEFENSE_DATA(); dEFENSE_DATA.SetData(data2); this.SetData(dEFENSE_DATA); } return(true); }
public int GetDefense(int nDefenseValue) { int result = 0; int key = 0; foreach (DEFENSE_DATA current in this.m_dicDefence_Data.Values) { if (nDefenseValue < current.m_nDEFENSE_VALUE) { DEFENSE_DATA dEFENSE_DATA = null; if (this.m_dicDefence_Data.TryGetValue(key, out dEFENSE_DATA)) { result = dEFENSE_DATA.m_nDAMAGE_DECREASE + (int)((float)(nDefenseValue - dEFENSE_DATA.m_nDEFENSE_VALUE) * dEFENSE_DATA.m_fDAMAGE_RATE); break; } } key = current.m_nIDX; } return(result); }
public void SetData(DEFENSE_DATA pkData) { this.m_dicDefence_Data.Add(pkData.m_nIDX, pkData); }