Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
diff FrmReplaceUnitEquipment.cs @ 10:19bdbb80999c
Closes #47 - Remove magic numbers
* Replace "magic number" -1s in WinForms with WarFoundryCore.INFINITY
Also:
* Code cleanup to remove warnings
* Code cleanup to replace space indentation with tabs
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 19 May 2009 18:51:32 +0000 |
parents | 755e60be28be |
children | 7c366fe55635 |
line wrap: on
line diff
--- a/FrmReplaceUnitEquipment.cs Tue May 19 11:10:07 2009 +0000 +++ b/FrmReplaceUnitEquipment.cs Tue May 19 18:51:32 2009 +0000 @@ -194,7 +194,7 @@ if (cbEquipAll.Checked) { - commandStack.Execute(new ReplaceUnitEquipmentCommand(unit, oldItem, equipItem, -1)); + commandStack.Execute(new ReplaceUnitEquipmentCommand(unit, oldItem, equipItem, WarFoundryCore.INFINITY)); } else { @@ -244,11 +244,11 @@ } else { - numEquipAmount.Minimum = (decimal)(equipItem.MinNumber != -1 ? equipItem.MinNumber : unit.Size); - numEquipAmount.Maximum = (decimal)(equipItem.MaxNumber != -1 ? equipItem.MaxNumber : unit.Size); + numEquipAmount.Minimum = (decimal)(equipItem.MinNumber != WarFoundryCore.INFINITY ? equipItem.MinNumber : unit.Size); + numEquipAmount.Maximum = (decimal)(equipItem.MaxNumber != WarFoundryCore.INFINITY ? equipItem.MaxNumber : unit.Size); numEquipAmount.Value = numEquipAmount.Minimum; - cbEquipAll.Enabled = (equipItem.MaxNumber == -1 && equipItem.MinNumber != -1); - cbEquipAll.Checked = equipItem.MinNumber == -1; + cbEquipAll.Enabled = (equipItem.MaxNumber == WarFoundryCore.INFINITY && equipItem.MinNumber != WarFoundryCore.INFINITY); + cbEquipAll.Checked = equipItem.MinNumber == WarFoundryCore.INFINITY; numEquipAmount.Width = 144; } }