Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison API/Objects/UnitType.cs @ 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 | 025319b6fa7a |
children | 95c1b68a600b |
comparison
equal
deleted
inserted
replaced
462:159dc9be36c2 | 463:cbeee87dc2d3 |
---|---|
3 // 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 // 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 using System; | 4 using System; |
5 using System.Collections.Generic; | 5 using System.Collections.Generic; |
6 using System.Xml; | 6 using System.Xml; |
7 using IBBoard.Limits; | 7 using IBBoard.Limits; |
8 using IBBoard.Logging; | |
9 using IBBoard.WarFoundry.API.Objects.Requirement; | 8 using IBBoard.WarFoundry.API.Objects.Requirement; |
10 | 9 |
11 namespace IBBoard.WarFoundry.API.Objects | 10 namespace IBBoard.WarFoundry.API.Objects |
12 { | 11 { |
13 /// <summary> | 12 /// <summary> |
189 private void CheckMinimumNumber() | 188 private void CheckMinimumNumber() |
190 { | 189 { |
191 if (MinNumber > MaxNumber && MaxNumber != WarFoundryCore.INFINITY) | 190 if (MinNumber > MaxNumber && MaxNumber != WarFoundryCore.INFINITY) |
192 { | 191 { |
193 MinNumber = MaxNumber; | 192 MinNumber = MaxNumber; |
194 LogNotifier.WarnFormat(GetType(), "Unit type {0} ({1}) had a minimum number greater than their maximum number.", Name, ID); | |
195 } | 193 } |
196 } | 194 } |
197 | 195 |
198 /// <summary> | 196 /// <summary> |
199 /// Makes sure that the minimum unit size isn't more than the maximum unit size, hence the warning on the properties | 197 /// Makes sure that the minimum unit size isn't more than the maximum unit size, hence the warning on the properties |
201 private void CheckMinimumSize() | 199 private void CheckMinimumSize() |
202 { | 200 { |
203 if (MinSize > MaxSize && MaxSize != WarFoundryCore.INFINITY) | 201 if (MinSize > MaxSize && MaxSize != WarFoundryCore.INFINITY) |
204 { | 202 { |
205 MinSize = MaxSize; | 203 MinSize = MaxSize; |
206 LogNotifier.WarnFormat(GetType(), "Unit type {0} ({1}) had a minimum size greater than their maximum size.", Name, ID); | |
207 } | 204 } |
208 } | 205 } |
209 | 206 |
210 //// <value> | 207 //// <value> |
211 /// Gets or sets the "base size" of a unit, which is the number of troopers the unit has in it for its "base cost". For a lot of units this value will be 0 as the cost is worked out based on the total number of members. | 208 /// Gets or sets the "base size" of a unit, which is the number of troopers the unit has in it for its "base cost". For a lot of units this value will be 0 as the cost is worked out based on the total number of members. |