public void UpdateData(BookData book) { bookData = book; bookData.MakeJsonToModel(); }
public void UpdateData(BookData book, ExpAndSecretData expAndSecret) { bookData = book; bookData.MakeJsonToModel(); expAndSecretData = expAndSecret; info = ""; if (bookData.MaxHPPlus != 0) { info += string.Format("最大气血:{0}", (bookData.MaxHPPlus > 0 ? "+" : "") + bookData.MaxHPPlus.ToString()); } if (bookData.PhysicsDefensePlus != 0) { info += info == "" ? "" : ", "; info += string.Format("外防:{0}", (bookData.PhysicsDefensePlus > 0 ? "+" : "") + bookData.PhysicsDefensePlus.ToString()); } if (bookData.MagicAttackPlus != 0) { info += info == "" ? "" : ", "; info += string.Format("内功:{0}", (bookData.MagicAttackPlus > 0 ? "+" : "") + bookData.MagicAttackPlus.ToString()); } if (bookData.MagicDefensePlus != 0) { info += info == "" ? "" : ", "; info += string.Format("内防:{0}", (bookData.MagicDefensePlus > 0 ? "+" : "") + bookData.MagicDefensePlus.ToString()); } if (bookData.DodgePlus != 0) { info += info == "" ? "" : ", "; info += string.Format("轻功:{0}", (bookData.DodgePlus > 0 ? "+" : "") + bookData.DodgePlus.ToString()); } if (bookData.HurtCutRatePlus != 0) { info += info == "" ? "" : ", "; info += string.Format("减伤:{0}%", (bookData.HurtCutRatePlus > 0 ? "+" : "") + (bookData.HurtCutRatePlus * 100).ToString()); } if (bookData.DrugResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗中毒:抵消{0}秒", bookData.DrugResistance); } if (bookData.DisarmResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗缴械:抵消{0}秒", bookData.DisarmResistance); } if (bookData.CanNotMoveResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗定身:抵消{0}秒", bookData.CanNotMoveResistance); } if (bookData.VertigoResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗眩晕:抵消{0}秒", bookData.VertigoResistance); } if (bookData.SlowResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗迟缓:抵消{0}秒", bookData.SlowResistance); } if (bookData.ChaosResistance > 0) { info += info == "" ? "" : ", "; info += string.Format("抗混乱:抵消{0}秒", bookData.ChaosResistance); } secretInfo = ""; if (expAndSecretData.Secrets.Count > 0) { for (int i = 0, len = expAndSecretData.Secrets.Count; i < len; i++) { secretInfo += expAndSecretData.Secrets[i].GetDesc(); if (i < len - 1) { secretInfo += ", "; } } } }