comparison api/Objects/Stats.cs @ 228:ece26f6a62f3

Re #223: Use translations within the API * Translate headings in basic HTML output * Remove some translation of exception messages (exceptions are for developers, users should get a message built from exception message) * Replace a string concat with String.Format Still need to check Requirements and below
author IBBoard <dev@ibboard.co.uk>
date Sun, 20 Dec 2009 20:59:28 +0000
parents 8c6f55d289b0
children a54da5a8b5bb
comparison
equal deleted inserted replaced
227:bf4f04f385d0 228:ece26f6a62f3
2 // 2 //
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 4
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using IBBoard.Lang;
8 7
9 namespace IBBoard.WarFoundry.API.Objects 8 namespace IBBoard.WarFoundry.API.Objects
10 { 9 {
11 /// <summary> 10 /// <summary>
12 /// Stats defines the statistic/attribute values for an entity (for example a unit or any of their equipment that has a stat line) paired against a <see cref=" SystemStats"/> stat line definition. 11 /// Stats defines the statistic/attribute values for an entity (for example a unit or any of their equipment that has a stat line) paired against a <see cref=" SystemStats"/> stat line definition.
60 { 59 {
61 stat = this[pos]; 60 stat = this[pos];
62 } 61 }
63 catch (ArgumentException ex) 62 catch (ArgumentException ex)
64 { 63 {
65 throw new ArgumentException(Translation.GetTranslation("InvalidStatPos", "Invalid statistic ID {0} for stats based on system stats set {1}", new object[]{id, sysStats.ID}), ex); 64 throw new ArgumentException(String.Format("Invalid statistic ID {0} for stats based on system stats set {1}", new object[]{id, sysStats.ID}), ex);
66 } 65 }
67 66
68 return stat; 67 return stat;
69 } 68 }
70 } 69 }
77 { 76 {
78 return stats[pos]; 77 return stats[pos];
79 } 78 }
80 else 79 else
81 { 80 {
82 throw new ArgumentException(Translation.GetTranslation("InvalidStatPos", "Invalid statistic position {0} for stats based on system stats set {1}", new object[]{pos, sysStats.ID})); 81 throw new ArgumentException(String.Format("Invalid statistic position {0} for stats based on system stats set {1}", new object[]{pos, sysStats.ID}));
83 } 82 }
84 } 83 }
85 } 84 }
86 85
87 public string GetStatValue(string id) 86 public string GetStatValue(string id)