Changeset 454:def5d333c5e8 in IBBoard.WarFoundry.API


Ignore:
Timestamp:
01/31/12 14:58:09 (4 months ago)
Author:
IBBoard <dev@…>
Branch:
default
Message:

Re #379: Fix validation of requirements to check for unit

  • Remove custom messages for overrides to reduce verbosity
  • Add missing multiplication signs for readability
Location:
API/Objects/Requirement
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • API/Objects/Requirement/RequiresNUnitsForMUnitsRequirement.cs

    r453 r454  
    6767                { 
    6868                    string unitTypeList = GetUnitTypeList(limit); 
    69                     failures.Add(String.Format("{0} {1} for every {2} {3} (would have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); 
     69                    failures.Add(String.Format("{0} × {1} for every {2} × {3} (would have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); 
    7070                } 
    7171            } 
     
    191191                { 
    192192                    string unitTypeList = GetUnitTypeList(limit); 
    193                     failures.Add(String.Format("{0} {1} for every {2} {3} (have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); 
     193                    failures.Add(String.Format("{0} × {1} for every {2} × {3} (have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); 
    194194                } 
    195195            } 
  • API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs

    r452 r454  
    3939            return IsApplicable(toArmy) ? base.ValidatesArmy(toArmy) : Validation.NotApplicable; 
    4040        } 
    41  
    42         protected override string ValidationFailedMessage 
    43         { 
    44             get 
    45             { 
    46                 return "Army contains " + requirementOnType.Name + " and so must contain: {0}."; 
    47             } 
    48         } 
    49  
    50         protected override string AllowsAddingFailedMessage 
    51         { 
    52             get 
    53             { 
    54                 return "Army would contain " + requirementOnType.Name + " and so must contain: {0}."; 
    55             } 
    56         } 
    5741    } 
    5842} 
  • API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs

    r453 r454  
    5151            return requirementOnType.Equals(toObject) || (toObject is Unit && requirementOnType.Equals(((Unit)toObject).UnitType)); 
    5252        } 
    53  
    54         protected override string ValidationFailedMessage 
    55         { 
    56             get 
    57             { 
    58                 return "Army contains " + requirementOnType.Name + " and so cannot contain more than: {0}."; 
    59             } 
    60         } 
    61  
    62         protected override string AllowsAddingFailedMessage 
    63         { 
    64             get 
    65             { 
    66                 return "Army would contain " + requirementOnType.Name + " and so cannot contain more than: {0}."; 
    67             } 
    68         } 
    6953    } 
    7054} 
Note: See TracChangeset for help on using the changeset viewer.