changeset 91:571d8ddc7d9a

Fixes #111: "Replace Weapon" button doesn't always enable * Change default ID to use name plus timestamp rather than fixed string plus timestamp - should hopefully be more unique Also: * Code cleanup (line endings) in XML race factory
author IBBoard <dev@ibboard.co.uk>
date Fri, 07 Aug 2009 19:22:08 +0000
parents bd2aaa9a61df
children 729d9e54162c
files api/Factories/Xml/WarFoundryXmlRaceFactory.cs api/Objects/WarFoundryObject.cs
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Aug 01 21:40:53 2009 +0000
     1.2 +++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Fri Aug 07 19:22:08 2009 +0000
     1.3 @@ -171,7 +171,7 @@
     1.4  					}
     1.5  					
     1.6  					try
     1.7 -					{
     1.8 +					{
     1.9  						unitEquipItem.MinNumber = int.Parse(equip.GetAttribute("minNum"));
    1.10  					}
    1.11  					catch (FormatException e)
    1.12 @@ -180,7 +180,7 @@
    1.13  					}
    1.14  					
    1.15  					try
    1.16 -					{
    1.17 +					{
    1.18  						unitEquipItem.MaxNumber = int.Parse(equip.GetAttribute("maxNum"));
    1.19  					}
    1.20  					catch (FormatException e)
    1.21 @@ -189,7 +189,7 @@
    1.22  					}
    1.23  					
    1.24  					try
    1.25 -					{
    1.26 +					{
    1.27  						unitEquipItem.MinPercentage = double.Parse(equip.GetAttribute("minPercentage"));
    1.28  					}
    1.29  					catch (FormatException e)
    1.30 @@ -198,7 +198,7 @@
    1.31  					}
    1.32  					
    1.33  					try
    1.34 -					{
    1.35 +					{
    1.36  						unitEquipItem.MaxPercentage = double.Parse(equip.GetAttribute("maxPercentage"));
    1.37  					}
    1.38  					catch (FormatException e)
    1.39 @@ -207,7 +207,7 @@
    1.40  					}
    1.41  					
    1.42  					try
    1.43 -					{
    1.44 +					{
    1.45  						unitEquipItem.CostMultiplier = double.Parse(equip.GetAttribute("costMultiplier"));
    1.46  					}
    1.47  					catch (FormatException e)
     2.1 --- a/api/Objects/WarFoundryObject.cs	Sat Aug 01 21:40:53 2009 +0000
     2.2 +++ b/api/Objects/WarFoundryObject.cs	Fri Aug 07 19:22:08 2009 +0000
     2.3 @@ -90,7 +90,7 @@
     2.4  
     2.5  		protected string GenerateID()
     2.6  		{
     2.7 -			return "ID" + UnixTimestamp.GetTimestamp(DateTime.Now) + "." + DateTime.Now.Millisecond;
     2.8 +			return Name + UnixTimestamp.GetTimestamp(DateTime.Now) + "." + DateTime.Now.Millisecond;
     2.9  		}
    2.10  	}
    2.11  }