# HG changeset patch # User IBBoard # Date 1312744533 0 # Node ID 30db6669f5cdff981d85aabfeae7740f769f54e2 # Parent 7036bf04e95544694874d447d09a7bf6d4a30798 * Update to VS.Net 2010 compatibility * Fix whitespace no-open-ticket diff -r 7036bf04e955 -r 30db6669f5cd API/Objects/Requirement/AbstractRequirement.cs --- a/API/Objects/Requirement/AbstractRequirement.cs Sat Jul 23 20:01:26 2011 +0000 +++ b/API/Objects/Requirement/AbstractRequirement.cs Sun Aug 07 19:15:33 2011 +0000 @@ -3,66 +3,67 @@ // 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. using System; + namespace IBBoard.WarFoundry.API.Objects.Requirement { public abstract class AbstractRequirement : IRequirement - { - public override bool Equals (object obj) - { - if (obj == null) - { - return false; - } - else if (obj.GetType().Equals(this.GetType())) - { - return TypeEquals(obj); - } - else - { - return false; - } - } - - /// - /// Type-specific equality checking - must be implemented by each class - /// - /// - /// true if this object is equal to obj, else false - /// - /// - /// The object to compare to - /// - protected abstract bool TypeEquals(object obj); - - protected virtual bool IsApplicable(WarFoundryObject toObjectAdded, Army toArmy) - { - return IsApplicable(toArmy) || IsApplicable(toObjectAdded); - } - - protected virtual bool IsApplicable(Army toArmy) - { - return true; - } - - protected virtual bool IsApplicable(WarFoundryObject toObject) - { - return true; - } - - - public string GetValidationMessage(Army army) - { - string message = ""; - - Validation result = ValidatesArmy(army); - if (!Validates.AsOkay(result)) - { - message = GetValidationFailedMessage(army); - } - - return message; + { + public override bool Equals (object obj) + { + if (obj == null) + { + return false; + } + else if (obj.GetType().Equals(this.GetType())) + { + return TypeEquals(obj); + } + else + { + return false; + } } - + + /// + /// Type-specific equality checking - must be implemented by each class + /// + /// + /// true if this object is equal to obj, else false + /// + /// + /// The object to compare to + /// + protected abstract bool TypeEquals(object obj); + + protected virtual bool IsApplicable(WarFoundryObject toObjectAdded, Army toArmy) + { + return IsApplicable(toArmy) || IsApplicable(toObjectAdded); + } + + protected virtual bool IsApplicable(Army toArmy) + { + return true; + } + + protected virtual bool IsApplicable(WarFoundryObject toObject) + { + return true; + } + + + public string GetValidationMessage(Army army) + { + string message = ""; + + Validation result = ValidatesArmy(army); + if (!Validates.AsOkay(result)) + { + message = GetValidationFailedMessage(army); + } + + return message; + } + protected abstract string GetValidationFailedMessage(Army army); public string GetAllowsAddingMessage(UnitType toAdd, Army toArmy) @@ -78,11 +79,11 @@ return message; } - protected abstract string GetAllowsAddingFailedMessage(UnitType toAdd, Army toArmy); - - public abstract Validation AllowsAdding(WarFoundryObject wfObject, Army toArmy); - - public abstract Validation ValidatesArmy(Army army); + protected abstract string GetAllowsAddingFailedMessage(UnitType toAdd, Army toArmy); + + public abstract Validation AllowsAdding(WarFoundryObject wfObject, Army toArmy); + + public abstract Validation ValidatesArmy(Army army); } } diff -r 7036bf04e955 -r 30db6669f5cd IBBoard.WarFoundry.API.csproj --- a/IBBoard.WarFoundry.API.csproj Sat Jul 23 20:01:26 2011 +0000 +++ b/IBBoard.WarFoundry.API.csproj Sun Aug 07 19:15:33 2011 +0000 @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -12,12 +12,10 @@ IBBoard.WarFoundry.API - 2.0 + 3.5 false - - v2.0 publish\ true