public TableWeaponSpeedLevel Get(int id) { TableWeaponSpeedLevel data = null; _ins.mDict.TryGetValue(id, out data); return(data); }
public virtual void Reset(int id, int powerLevel, int speedLevel) { this.id = id; if (id <= 0) { return; } table = TableWeapon.Get(id); tablePower = TableWeaponPowerLevel.Get(_ => _.weaponId == id && _.level == powerLevel); tableSpeed = TableWeaponSpeedLevel.Get(_ => _.weaponId == id && _.level == speedLevel); rechargeDuration = tableSpeed.recharge; damage = tablePower.damage; effects[0] = table.effect1 * tablePower.effectFactor1 * tableSpeed.effectFactor1; effects[1] = table.effect2 * tablePower.effectFactor2 * tableSpeed.effectFactor2; effects[2] = table.effect3 * tablePower.effectFactor3 * tableSpeed.effectFactor3; effects[3] = table.effect4 * tablePower.effectFactor4 * tableSpeed.effectFactor4; effects[4] = table.effect5 * tablePower.effectFactor5 * tableSpeed.effectFactor5; mUnitIndex = 0; mUnitCD.Clear(); for (int i = 0; i < unitCount; i++) { mUnitCD.Add(rechargeDuration); } }