Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iHP - HP Washing Calculation Program
#13
JoeTang Wrote:Java uses double pikes (||) to denote OR operators in conditional statements. Personally, I would go the route of Select Case for that particular function type, with a variable change, and a single formula elsewhere, since the formula gets executed regardless of job, and there are only x and y differences for each class.
Can't recall the syntax for a Select Case in VB, so a switch statement in java:
Code:
int x;
int y;
switch (cmbClass.Text)
{
  case "Thief (2nd)":
  case "Thief(3rd/4th)":
    x = 12;
    y = 20; break;
  case "Fighter":
  case "Spearman/DK":
    x = 4;
    y = 50; break;
  default:
    x = 0;
    y = 0;
}
  txtWashable.Text = int.ParseInt(txtCurMP.Text) - int.ParseInt(txtMP.Text);
  txtWashable.Text = int.ParseInt(txtWashable.Text) / x;
  txtAfter.Text = y * int.ParseInt(txtWashable.Text) + int.ParseInt(txtCurHP.Text);

If you don't break it will not do what you expect Tongue


ed: Yeah, Swing would be the reason I never updated my damage calculator for 4th job skills. I'd need about 30 checkbox/radio buttons with associated skill name + levels. :/
Reply


Messages In This Thread
iHP - HP Washing Calculation Program - by god - 2009-04-18, 03:52 PM
iHP - HP Washing Calculation Program - by Mark - 2009-04-18, 03:58 PM
iHP - HP Washing Calculation Program - by Beaner - 2009-04-18, 04:00 PM
iHP - HP Washing Calculation Program - by god - 2009-04-18, 04:00 PM
iHP - HP Washing Calculation Program - by Beaner - 2009-04-18, 04:05 PM
iHP - HP Washing Calculation Program - by Mark - 2009-04-18, 04:07 PM
iHP - HP Washing Calculation Program - by god - 2009-04-18, 05:57 PM
iHP - HP Washing Calculation Program - by JoeTang - 2009-04-18, 06:04 PM
iHP - HP Washing Calculation Program - by god - 2009-04-19, 04:13 AM
iHP - HP Washing Calculation Program - by JoeTang - 2009-04-19, 04:23 AM
iHP - HP Washing Calculation Program - by god - 2009-04-19, 04:28 AM
iHP - HP Washing Calculation Program - by Zenkat - 2009-04-24, 03:22 AM
iHP - HP Washing Calculation Program - by Stereo - 2009-04-24, 03:41 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)