changeset 463:cbeee87dc2d3

Re #58: Remove LogNotifier from API * Remove LogNotifier from API - mostly unnecessary logging Also: * Formatting auto-corrected * LoadFile() "try...catch {silently dispose}" removed. Code shouldn't be throwing those errors and needs to be handled elsewhere if it does
author IBBoard <dev@ibboard.co.uk>
date Sat, 17 Mar 2012 20:02:32 +0000
parents 159dc9be36c2
children 59e1fb8a476a
files API/AbstractWarFoundryLoader.cs API/Factories/AbstractNativeWarFoundryFactory.cs API/Factories/AbstractNonNativeFileExtensionWarFoundryFactory.cs API/Factories/Xml/WarFoundryXmlFactory.cs API/Objects/Category.cs API/Objects/UnitType.cs API/WarFoundryCore.cs
diffstat 7 files changed, 47 insertions(+), 98 deletions(-) [+]
line diff
     1.1 --- a/API/AbstractWarFoundryLoader.cs	Tue Mar 06 20:31:31 2012 +0000
     1.2 +++ b/API/AbstractWarFoundryLoader.cs	Sat Mar 17 20:02:32 2012 +0000
     1.3 @@ -1,13 +1,11 @@
     1.4  // This file (AbstractWarFoundryLoader.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard
     1.5  // 
     1.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     1.7 -
     1.8  using System;
     1.9  using System.Collections.Generic;
    1.10  using System.IO;
    1.11  using IBBoard.Collections;
    1.12  using IBBoard.IO;
    1.13 -using IBBoard.Logging;
    1.14  using IBBoard.WarFoundry.API.Factories;
    1.15  using IBBoard.WarFoundry.API.Objects;
    1.16  
    1.17 @@ -26,7 +24,6 @@
    1.18  		public delegate void FileLoadingCompleteDelegate(List<FileLoadFailure> failures);
    1.19  
    1.20  		public event MethodInvoker FileLoadingStarted;
    1.21 -
    1.22  		public event FileLoadingCompleteDelegate FileLoadingFinished;
    1.23  
    1.24  		protected AbstractWarFoundryLoader()
    1.25 @@ -180,10 +177,6 @@
    1.26  					List<FileLoadFailure> directoryFails = FillLoadableFilesForDirectory(loadableRaces, loadableGameSystems, directory);
    1.27  					fails.AddRange(directoryFails);
    1.28  				}
    1.29 -				else
    1.30 -				{
    1.31 -					LogNotifier.WarnFormat(GetType(), "Load for {0} failed because directory didn't exist", directory.FullName);
    1.32 -				}
    1.33  			}
    1.34  			
    1.35  			return fails;
    1.36 @@ -192,7 +185,6 @@
    1.37  		private List<FileLoadFailure> FillLoadableFilesForDirectory(Dictionary<FileInfo, IWarFoundryFactory> loadableRaces, Dictionary<FileInfo, IWarFoundryFactory> loadableGameSystems, DirectoryInfo directory)
    1.38  		{
    1.39  			List<FileLoadFailure> fails = new List<FileLoadFailure>();
    1.40 -			LogNotifier.Debug(GetType(), "Load from " + directory.FullName);
    1.41  		
    1.42  			foreach (FileInfo file in directory.GetFiles())
    1.43  			{
    1.44 @@ -214,7 +206,6 @@
    1.45  					{
    1.46  						FileLoadFailure failure = new FileLoadFailure(file, "File not handled as a Race or Game System definition: {0}", "FileNotHandled");
    1.47  						fails.Add(failure);
    1.48 -						LogNotifier.Info(GetType(), failure.Message);
    1.49  					}
    1.50  				}
    1.51  			}
    1.52 @@ -309,7 +300,6 @@
    1.53  				if (failure != null)
    1.54  				{
    1.55  					fails.Add(failure);
    1.56 -					LogNotifier.Warn(GetType(), failure.Message, failure.Exception);
    1.57  				}
    1.58  			}
    1.59  			
    1.60 @@ -341,7 +331,6 @@
    1.61  				if (failure != null)
    1.62  				{
    1.63  					fails.Add(failure);
    1.64 -					LogNotifier.Warn(GetType(), failure.Message, failure.Exception);
    1.65  				}
    1.66  			}
    1.67  			
    1.68 @@ -350,9 +339,8 @@
    1.69  
    1.70  		private bool LoadObject(FileInfo file, IWarFoundryFactory factory)
    1.71  		{
    1.72 -			LogNotifier.DebugFormat(GetType(), "Loading {0} using {1}", file.FullName, factory.GetType().Name);
    1.73 -			factory.RaceLoaded+= StoreRace;
    1.74 -			factory.GameSystemLoaded+= StoreGameSystem;
    1.75 +			factory.RaceLoaded += StoreRace;
    1.76 +			factory.GameSystemLoaded += StoreGameSystem;
    1.77  			ICollection<IWarFoundryObject> objects = factory.CreateObjectsFromFile(file);
    1.78  			return objects.Count > 0;
    1.79  		}
    1.80 @@ -369,21 +357,12 @@
    1.81  		/// </returns>
    1.82  		public ICollection<IWarFoundryObject> LoadFile(FileInfo file)
    1.83  		{
    1.84 -			ICollection<IWarFoundryObject> objs = null;
    1.85  			IWarFoundryFactory loadFactory = null;
    1.86 -			
    1.87 -			try
    1.88 +			ICollection<IWarFoundryObject> objs = LoadFileWithNonNativeFactories(file, out loadFactory);
    1.89 +				
    1.90 +			if (objs == null)
    1.91  			{
    1.92 -				objs = LoadFileWithNonNativeFactories(file, out loadFactory);
    1.93 -				
    1.94 -				if (objs == null)
    1.95 -				{
    1.96 -					objs = LoadFileWithNativeFactories(file, out loadFactory);
    1.97 -				}
    1.98 -			}
    1.99 -			catch (InvalidFileException ex)
   1.100 -			{
   1.101 -				LogNotifier.Error(GetType(), file.FullName + " failed to load", ex);
   1.102 +				objs = LoadFileWithNativeFactories(file, out loadFactory);
   1.103  			}
   1.104  				
   1.105  			if (objs != null)
   1.106 @@ -405,12 +384,9 @@
   1.107  			
   1.108  			if (nonNativeFactories.Count > 0)
   1.109  			{
   1.110 -				LogNotifier.Debug(GetType(), "Attempting to load " + file.FullName + " as a non-native file");
   1.111 -				
   1.112  				foreach (INonNativeWarFoundryFactory factory in nonNativeFactories)
   1.113  				{
   1.114  					bool canLoad = factory.CanHandleFileFormat(file);
   1.115 -					LogNotifier.Debug(GetType(), "Load using " + factory.GetType().FullName + "? " + (canLoad ? "yes" : "no"));
   1.116  					
   1.117  					if (canLoad)
   1.118  					{
   1.119 @@ -435,8 +411,6 @@
   1.120  			
   1.121  			if (factories.Count > 0)
   1.122  			{
   1.123 -				LogNotifier.Debug(GetType(), "Attempting to load " + file.FullName + " as native file");
   1.124 -						
   1.125  				foreach (INativeWarFoundryFactory factory in factories)
   1.126  				{
   1.127  					if (factory.CanHandleFileFormat(file))
     2.1 --- a/API/Factories/AbstractNativeWarFoundryFactory.cs	Tue Mar 06 20:31:31 2012 +0000
     2.2 +++ b/API/Factories/AbstractNativeWarFoundryFactory.cs	Sat Mar 17 20:02:32 2012 +0000
     2.3 @@ -1,7 +1,6 @@
     2.4  // This file (AbstractNativeWarFoundryFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
     2.5  //
     2.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     2.7 -
     2.8  using System;
     2.9  using System.IO;
    2.10  using System.Xml;
    2.11 @@ -11,7 +10,6 @@
    2.12  using IBBoard;
    2.13  using IBBoard.IO;
    2.14  using IBBoard.Lang;
    2.15 -using IBBoard.Logging;
    2.16  using IBBoard.Xml;
    2.17  using IBBoard.WarFoundry.API.Objects;
    2.18  using ICSharpCode.SharpZipLib.Zip;
    2.19 @@ -52,7 +50,7 @@
    2.20  			return zip;
    2.21  		}
    2.22  		
    2.23 -		protected override bool CheckCanHandleFileFormat (ZipFile file)
    2.24 +		protected override bool CheckCanHandleFileFormat(ZipFile file)
    2.25  		{	
    2.26  			return CheckCanHandleFileAsGameSystem(file) || CheckCanHandleFileAsRace(file) || CheckCanHandleFileAsArmy(file); 
    2.27  		}
    2.28 @@ -78,7 +76,7 @@
    2.29  		
    2.30  		protected abstract bool CheckCanFindArmyFileContent(ZipFile file);
    2.31  		
    2.32 -		protected override ICollection<IWarFoundryObject> DoCreateObjectsFromFile (ZipFile file)
    2.33 +		protected override ICollection<IWarFoundryObject> DoCreateObjectsFromFile(ZipFile file)
    2.34  		{
    2.35  			ICollection<IWarFoundryObject> objects = new List<IWarFoundryObject>();
    2.36  
    2.37 @@ -94,9 +92,9 @@
    2.38  		{
    2.39  			try
    2.40  			{
    2.41 -				CreateSystemObjectsFromZip (file, objects);
    2.42 -				CreateRaceObjectsFromZip (file, objects);
    2.43 -				CreateArmyObjectsFromZip (file, objects);
    2.44 +				CreateSystemObjectsFromZip(file, objects);
    2.45 +				CreateRaceObjectsFromZip(file, objects);
    2.46 +				CreateArmyObjectsFromZip(file, objects);
    2.47  			}
    2.48  			finally
    2.49  			{
    2.50 @@ -104,7 +102,7 @@
    2.51  			}
    2.52  		}
    2.53  
    2.54 -		private void CreateSystemObjectsFromZip (ZipFile file, ICollection<IWarFoundryObject> objects)
    2.55 +		private void CreateSystemObjectsFromZip(ZipFile file, ICollection<IWarFoundryObject> objects)
    2.56  		{
    2.57  			if (CheckCanFindSystemFileContent(file))
    2.58  			{
    2.59 @@ -116,11 +114,11 @@
    2.60  			}
    2.61  		}
    2.62  
    2.63 -		void CreateRaceObjectsFromZip (ZipFile file, ICollection<IWarFoundryObject> objects)
    2.64 +		void CreateRaceObjectsFromZip(ZipFile file, ICollection<IWarFoundryObject> objects)
    2.65  		{
    2.66  			if (CheckCanFindRaceFileContent(file))
    2.67  			{
    2.68 -				foreach(Race race in CreateRacesFromFile(file))
    2.69 +				foreach (Race race in CreateRacesFromFile(file))
    2.70  				{
    2.71  					OnRaceLoaded(race);
    2.72  					objects.Add(race);
    2.73 @@ -128,7 +126,7 @@
    2.74  			}
    2.75  		}
    2.76  
    2.77 -		void CreateArmyObjectsFromZip (ZipFile file, ICollection<IWarFoundryObject> objects)
    2.78 +		void CreateArmyObjectsFromZip(ZipFile file, ICollection<IWarFoundryObject> objects)
    2.79  		{
    2.80  			if (CheckCanFindArmyFileContent(file))
    2.81  			{
    2.82 @@ -169,6 +167,7 @@
    2.83  		}
    2.84  		
    2.85  		protected abstract ICollection<ZipEntry> GetArmyZipEntries(ZipFile file);
    2.86 +
    2.87  		protected abstract Army CreateArmyFromStream(ZipFile file, Stream dataStream);
    2.88  		
    2.89  		protected ICollection<Race> CreateRacesFromFile(ZipFile file)
    2.90 @@ -193,6 +192,7 @@
    2.91  		}
    2.92  		
    2.93  		protected abstract ICollection<ZipEntry> GetRaceZipEntries(ZipFile file);
    2.94 +
    2.95  		protected abstract Race CreateRaceFromStream(ZipFile file, Stream dataStream);
    2.96  		
    2.97  		protected ICollection<GameSystem> CreateGameSystemsFromFile(ZipFile file)
    2.98 @@ -217,9 +217,10 @@
    2.99  		}
   2.100  		
   2.101  		protected abstract ICollection<ZipEntry> GetGameSystemZipEntries(ZipFile file);
   2.102 +
   2.103  		protected abstract GameSystem CreateGameSystemFromStream(ZipFile file, Stream dataStream);
   2.104  		
   2.105 -		public override bool Equals (object o)
   2.106 +		public override bool Equals(object o)
   2.107  		{
   2.108  			if (o == this)
   2.109  			{
   2.110 @@ -233,7 +234,7 @@
   2.111  			return true;
   2.112  		}
   2.113  		
   2.114 -		public override int GetHashCode ()
   2.115 +		public override int GetHashCode()
   2.116  		{
   2.117  			return GetType().FullName.GetHashCode();
   2.118  		}
     3.1 --- a/API/Factories/AbstractNonNativeFileExtensionWarFoundryFactory.cs	Tue Mar 06 20:31:31 2012 +0000
     3.2 +++ b/API/Factories/AbstractNonNativeFileExtensionWarFoundryFactory.cs	Sat Mar 17 20:02:32 2012 +0000
     3.3 @@ -1,11 +1,9 @@
     3.4  // This file (AbstractNonNativeFileExtensionWarFoundryFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
     3.5  //
     3.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     3.7 -
     3.8  using System;
     3.9  using System.Collections.Generic;
    3.10  using System.IO;
    3.11 -using IBBoard.Logging;
    3.12  using IBBoard.WarFoundry.API.Objects;
    3.13  
    3.14  namespace IBBoard.WarFoundry.API.Factories
    3.15 @@ -13,64 +11,64 @@
    3.16  	public abstract class AbstractNonNativeFileExtensionWarFoundryFactory : AbstractNonNativeWarFoundryFactory<FileInfo>
    3.17  	{
    3.18  		protected abstract string ArmyFileExtension { get; }
    3.19 +
    3.20  		protected abstract string RaceFileExtension { get; }
    3.21 +
    3.22  		protected abstract string GameSystemFileExtension { get; }
    3.23  		
    3.24 -		protected override bool CheckCanHandleFileFormat (FileInfo file)
    3.25 +		protected override bool CheckCanHandleFileFormat(FileInfo file)
    3.26  		{
    3.27  			return CheckCanHandleFileAsArmy(file) || CheckCanHandleFileAsRace(file) || CheckCanHandleFileAsGameSystem(file);
    3.28  		}
    3.29  		
    3.30  		protected override bool CheckCanHandleFileAsArmy(FileInfo file)
    3.31  		{
    3.32 -			return ArmyFileExtension!=null && file.Name.ToLower().EndsWith(ArmyFileExtension);
    3.33 +			return ArmyFileExtension != null && file.Name.ToLower().EndsWith(ArmyFileExtension);
    3.34  		}
    3.35  		
    3.36  		protected override bool CheckCanHandleFileAsRace(FileInfo file)
    3.37  		{
    3.38 -			return RaceFileExtension!=null && file.Name.ToLower().EndsWith(RaceFileExtension);
    3.39 +			return RaceFileExtension != null && file.Name.ToLower().EndsWith(RaceFileExtension);
    3.40  		}
    3.41  		
    3.42  		protected override bool CheckCanHandleFileAsGameSystem(FileInfo file)
    3.43  		{
    3.44 -			return GameSystemFileExtension!=null && file.Name.ToLower().EndsWith(GameSystemFileExtension);
    3.45 +			return GameSystemFileExtension != null && file.Name.ToLower().EndsWith(GameSystemFileExtension);
    3.46  		}
    3.47  		
    3.48 -		protected override FileInfo GetFileAsSupportedType (FileInfo file)
    3.49 +		protected override FileInfo GetFileAsSupportedType(FileInfo file)
    3.50  		{
    3.51  			return file;
    3.52 -		}		
    3.53 +		}
    3.54  		
    3.55  		protected abstract Army CreateArmyFromFile(FileInfo file);
    3.56 +
    3.57  		protected abstract Race CreateRaceFromFile(FileInfo file);
    3.58 +
    3.59  		protected abstract GameSystem CreateGameSystemFromFile(FileInfo file);
    3.60  		
    3.61 -		protected override ICollection<IWarFoundryObject> DoCreateObjectsFromFile (FileInfo file)
    3.62 +		protected override ICollection<IWarFoundryObject> DoCreateObjectsFromFile(FileInfo file)
    3.63  		{
    3.64  			IWarFoundryObject obj = null;
    3.65  			
    3.66  			if (CheckCanHandleFileAsGameSystem(file))
    3.67  			{
    3.68 -				GameSystem gameSystem = CreateGameSystemFromFile (file);
    3.69 +				GameSystem gameSystem = CreateGameSystemFromFile(file);
    3.70  				OnGameSystemLoaded(gameSystem);
    3.71  				obj = gameSystem;
    3.72  			}
    3.73  			else if (CheckCanHandleFileAsRace(file))
    3.74  			{
    3.75 -				Race race = CreateRaceFromFile (file);
    3.76 +				Race race = CreateRaceFromFile(file);
    3.77  				OnRaceLoaded(race);
    3.78  				obj = race;
    3.79  			}
    3.80 -			else if (CheckCanHandleFileAsArmy(file))
    3.81 +			else //Must have been an army file
    3.82  			{
    3.83 -				Army army = CreateArmyFromFile (file);
    3.84 +				Army army = CreateArmyFromFile(file);
    3.85  				OnArmyLoaded(army);
    3.86  				obj = army;
    3.87  			}
    3.88 -			else
    3.89 -			{
    3.90 -				LogNotifier.Warn(GetType(), "Failed trying to create from "+file.FullName+" - not a Race, Army or GameSystem");
    3.91 -			}
    3.92  			
    3.93  			ICollection<IWarFoundryObject> objects = new List<IWarFoundryObject>();
    3.94  			
     4.1 --- a/API/Factories/Xml/WarFoundryXmlFactory.cs	Tue Mar 06 20:31:31 2012 +0000
     4.2 +++ b/API/Factories/Xml/WarFoundryXmlFactory.cs	Sat Mar 17 20:02:32 2012 +0000
     4.3 @@ -1,7 +1,6 @@
     4.4  // This file (WarFoundryXmlFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
     4.5  //
     4.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     4.7 -
     4.8  using System;
     4.9  using System.IO;
    4.10  using System.Xml;
    4.11 @@ -12,7 +11,6 @@
    4.12  using IBBoard;
    4.13  using IBBoard.IO;
    4.14  using IBBoard.Lang;
    4.15 -using IBBoard.Logging;
    4.16  using IBBoard.Xml;
    4.17  using IBBoard.WarFoundry.API.Objects;
    4.18  using ICSharpCode.SharpZipLib.Zip;
    4.19 @@ -98,7 +96,7 @@
    4.20  			return entries;
    4.21  		}
    4.22  		
    4.23 -		protected override Army CreateArmyFromStream (ZipFile file, Stream dataStream)
    4.24 +		protected override Army CreateArmyFromStream(ZipFile file, Stream dataStream)
    4.25  		{
    4.26  			XmlElement elem = GetRootElementFromStream(dataStream, WarFoundryXmlElementName.ARMY_ELEMENT);
    4.27  			return armyFactory.CreateArmyFromElement(file, elem);
    4.28 @@ -123,10 +121,9 @@
    4.29  			return FindEntries(file, "*.systemx");
    4.30  		}
    4.31  		
    4.32 -		protected override GameSystem CreateGameSystemFromStream (ZipFile file, Stream dataStream)
    4.33 +		protected override GameSystem CreateGameSystemFromStream(ZipFile file, Stream dataStream)
    4.34  		{
    4.35  			XmlElement elem = GetRootElementFromStream(dataStream, WarFoundryXmlElementName.SYSTEM_ELEMENT);
    4.36 -			LogNotifier.Debug(GetType(), "Create GameSystem");
    4.37  			return gameSystemFactory.CreateSystemFromElement(file, elem);
    4.38  		}
    4.39  		
    4.40 @@ -135,10 +132,9 @@
    4.41  			return FindEntries(file, "*.racex");
    4.42  		}
    4.43  		
    4.44 -		protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream)
    4.45 +		protected override Race CreateRaceFromStream(ZipFile file, Stream dataStream)
    4.46  		{
    4.47  			XmlElement elem = GetRootElementFromStream(dataStream, WarFoundryXmlElementName.RACE_ELEMENT);
    4.48 -			LogNotifier.Debug(GetType(), "Create Race");
    4.49  			return raceFactory.CreateRace(elem);
    4.50  		}
    4.51  
    4.52 @@ -148,16 +144,14 @@
    4.53  		}
    4.54  
    4.55  		public override void CompleteLoading(IWarFoundryStagedLoadObject obj)
    4.56 -		{			
    4.57 -			LogNotifier.DebugFormat(GetType(), "Complete loading of {0} with ID {1}", obj.GetType().Name, obj.ID);
    4.58 -
    4.59 +		{
    4.60  			if (obj is GameSystem)
    4.61  			{
    4.62 -				CompleteLoadingGameSystem((GameSystem) obj);
    4.63 +				CompleteLoadingGameSystem((GameSystem)obj);
    4.64  			}
    4.65  			else if (obj is Race)
    4.66  			{
    4.67 -				CompleteLoadingRace((Race) obj);
    4.68 +				CompleteLoadingRace((Race)obj);
    4.69  			}
    4.70  		}
    4.71  
     5.1 --- a/API/Objects/Category.cs	Tue Mar 06 20:31:31 2012 +0000
     5.2 +++ b/API/Objects/Category.cs	Sat Mar 17 20:02:32 2012 +0000
     5.3 @@ -1,10 +1,8 @@
     5.4  // This file (Category.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
     5.5  //
     5.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     5.7 -
     5.8  using System;
     5.9  using System.Xml;
    5.10 -using IBBoard.Logging;
    5.11  
    5.12  namespace IBBoard.WarFoundry.API.Objects
    5.13  {
    5.14 @@ -17,7 +15,6 @@
    5.15  		private int maxPts = WarFoundryCore.INFINITY;
    5.16  		private int minPc = 0;
    5.17  		private int maxPc = 100;
    5.18 -
    5.19  		
    5.20  		public Category(string id, string name) : base(id, name)
    5.21  		{
    5.22 @@ -59,10 +56,9 @@
    5.23  		/// </summary>
    5.24  		private void CheckMinimumPoints()
    5.25  		{
    5.26 -			if (MinimumPoints > MaximumPoints && MaximumPoints!=WarFoundryCore.INFINITY)
    5.27 +			if (MinimumPoints > MaximumPoints && MaximumPoints != WarFoundryCore.INFINITY)
    5.28  			{
    5.29  				MinimumPoints = MaximumPoints;
    5.30 -				LogNotifier.WarnFormat(GetType(), "Category {0} ({1}) had a minimum points limit greater than its maximum points limit.", Name, ID);
    5.31  			}
    5.32  		}
    5.33  		
    5.34 @@ -112,7 +108,6 @@
    5.35  			if (MinimumPercentage > MaximumPercentage)
    5.36  			{
    5.37  				MinimumPercentage = MaximumPercentage;
    5.38 -				LogNotifier.WarnFormat(GetType(), "Category {0} ({1}) had a minimum percentage limit greater than its maximum percentage limit.", Name, ID);
    5.39  			}
    5.40  		}
    5.41  	}
     6.1 --- a/API/Objects/UnitType.cs	Tue Mar 06 20:31:31 2012 +0000
     6.2 +++ b/API/Objects/UnitType.cs	Sat Mar 17 20:02:32 2012 +0000
     6.3 @@ -5,7 +5,6 @@
     6.4  using System.Collections.Generic;
     6.5  using System.Xml;
     6.6  using IBBoard.Limits;
     6.7 -using IBBoard.Logging;
     6.8  using IBBoard.WarFoundry.API.Objects.Requirement;
     6.9  
    6.10  namespace IBBoard.WarFoundry.API.Objects
    6.11 @@ -191,7 +190,6 @@
    6.12  			if (MinNumber > MaxNumber && MaxNumber != WarFoundryCore.INFINITY)
    6.13  			{
    6.14  				MinNumber = MaxNumber;
    6.15 -				LogNotifier.WarnFormat(GetType(), "Unit type {0} ({1}) had a minimum number greater than their maximum number.", Name, ID);
    6.16  			}
    6.17  		}
    6.18  
    6.19 @@ -203,7 +201,6 @@
    6.20  			if (MinSize > MaxSize && MaxSize != WarFoundryCore.INFINITY)
    6.21  			{
    6.22  				MinSize = MaxSize;
    6.23 -				LogNotifier.WarnFormat(GetType(), "Unit type {0} ({1}) had a minimum size greater than their maximum size.", Name, ID);
    6.24  			}
    6.25  		}
    6.26  		
     7.1 --- a/API/WarFoundryCore.cs	Tue Mar 06 20:31:31 2012 +0000
     7.2 +++ b/API/WarFoundryCore.cs	Sat Mar 17 20:02:32 2012 +0000
     7.3 @@ -1,9 +1,7 @@
     7.4  // This file (WarFoundryCore.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
     7.5  //
     7.6  // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     7.7 -
     7.8  using System;
     7.9 -using IBBoard.Logging;
    7.10  using IBBoard.WarFoundry.API.Objects;
    7.11  
    7.12  namespace IBBoard.WarFoundry.API
    7.13 @@ -16,6 +14,7 @@
    7.14  		}
    7.15  
    7.16  		public static readonly int INFINITY = -1;
    7.17 +
    7.18  		public static event GameSystemChangedDelegate GameSystemChanged;
    7.19  		public static event ArmyChangedDelegate ArmyChanged;
    7.20  		
    7.21 @@ -27,21 +26,12 @@
    7.22  			get { return system; }
    7.23  			set
    7.24  			{
    7.25 -				if (system==null || !system.Equals(value))
    7.26 +				if (system == null || !system.Equals(value))
    7.27  				{
    7.28  					GameSystem oldSystem = system;
    7.29  					system = value;
    7.30 -					
    7.31 -					if (system==null)
    7.32 -					{
    7.33 -						LogNotifier.Debug(typeof(WarFoundryCore), "Game system set to null");
    7.34 -					}
    7.35 -					else
    7.36 -					{
    7.37 -						LogNotifier.DebugFormat(typeof(WarFoundryCore), "Game system set to {0} with ID {1}", system.Name, system.ID); 
    7.38 -					}
    7.39  
    7.40 -					if (GameSystemChanged!=null)
    7.41 +					if (GameSystemChanged != null)
    7.42  					{
    7.43  						GameSystemChanged(oldSystem, system);
    7.44  					}
    7.45 @@ -57,7 +47,7 @@
    7.46  			get { return currentArmy; }
    7.47  			set
    7.48  			{
    7.49 -				if (currentArmy==null || !currentArmy.Equals(value))
    7.50 +				if (currentArmy == null || !currentArmy.Equals(value))
    7.51  				{
    7.52  					Army oldArmy = currentArmy;
    7.53  					
    7.54 @@ -71,7 +61,7 @@
    7.55  						currentArmy = null;
    7.56  					}
    7.57  					
    7.58 -					if (ArmyChanged!=null)
    7.59 +					if (ArmyChanged != null)
    7.60  					{
    7.61  						ArmyChanged(oldArmy, currentArmy);
    7.62  					}