public static PropertyRes GetAppreciationString(Property cur, Property next, PropertyType type) { PropertyRes res = new PropertyRes(); int d0 = 0, d1 = 0; switch (type) { case PropertyType.Attack: { d0 = cur.attack; if (next != null) d1 = next.attack; } break; case PropertyType.AttackRange: { d0 = cur.attackRange; if (next != null) d1 = next.attackRange; } break; case PropertyType.Defense: { d0 = cur.defence; if (next != null) d1 = next.defence; } break; case PropertyType.HP: { d0 = cur.hp; if (next != null) d1 = next.hp; } break; case PropertyType.Speed: { d0 = cur.speed; if (next != null) d1 = next.speed; } break; } if (d0 > 0 && d1 == 0) { res.value = string.Format(_curFormat, Localization.Get((int)type + 110), d0); res.valid = true; } else if (d0 > 0 && d1 > 0) { res.value = string.Format(_appreciationFormat, Localization.Get((int)type + 110), d0, d1 - d0); res.valid = true; } return res; }
public static PropertyRes GetAppreciationString(Property cur, Property next, PropertyType type) { PropertyRes res = new PropertyRes(); int d0 = 0, d1 = 0; switch (type) { case PropertyType.Attack: { d0 = cur.attack; if (next != null) { d1 = next.attack; } } break; case PropertyType.AttackRange: { d0 = cur.attackRange; if (next != null) { d1 = next.attackRange; } } break; case PropertyType.Defense: { d0 = cur.defence; if (next != null) { d1 = next.defence; } } break; case PropertyType.HP: { d0 = cur.hp; if (next != null) { d1 = next.hp; } } break; case PropertyType.Speed: { d0 = cur.speed; if (next != null) { d1 = next.speed; } } break; } if (d0 > 0 && d1 == 0) { res.value = string.Format(_curFormat, Localization.Get((int)type + 110), d0); res.valid = true; } else if (d0 > 0 && d1 > 0) { res.value = string.Format(_appreciationFormat, Localization.Get((int)type + 110), d0, d1 - d0); res.valid = true; } return(res); }