2009-04-19, 04:23 AM
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:
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;
case "Fighter":
case "Spearman/DK":
x = 4;
y = 50;
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);
