2009-04-24, 03:41 AM
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

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. :/

