changeset 391:d051f8f44e6c default-army-name

Re #99: added points name system to GameSystem
author snowblizz
date Mon, 24 Jan 2011 16:42:43 +0000
parents 4e0031339bcb
children dc6243326a93
files api/Objects/GameSystem.cs
diffstat 1 files changed, 395 insertions(+), 225 deletions(-) [+]
line diff
     1.1 --- a/api/Objects/GameSystem.cs	Sun Dec 12 15:27:07 2010 +0000
     1.2 +++ b/api/Objects/GameSystem.cs	Mon Jan 24 16:42:43 2011 +0000
     1.3 @@ -7,33 +7,44 @@
     1.4  using System.Xml;
     1.5  using System.IO;
     1.6  using IBBoard.Logging;
     1.7 +using IBBoard.Lang;
     1.8  using IBBoard.WarFoundry.API.Factories;
     1.9  using ICSharpCode.SharpZipLib.Zip;
    1.10  
    1.11  namespace IBBoard.WarFoundry.API.Objects
    1.12  {
    1.13 -	/// <summary>
    1.14 -	/// Summary description for GameSystem.
    1.15 -	/// </summary>
    1.16 -	public class GameSystem : WarFoundryStagedLoadingObject
    1.17 -	{
    1.18 -        private static int SYSTEM_DEFAULT_ARMY_SIZE = 1000;
    1.19 +    /// <summary>
    1.20 +    /// Summary description for GameSystem.
    1.21 +    /// </summary>
    1.22 +    public class GameSystem : WarFoundryStagedLoadingObject
    1.23 +    {
    1.24 +        private static decimal SYSTEM_DEFAULT_ARMY_SIZE = 1000;
    1.25          private bool warnOnError;
    1.26 -		private bool allowAllies;
    1.27 -		private Dictionary<string, Category> categories = new Dictionary<string,Category>();
    1.28 -		private Dictionary<string, SystemStats> stats = new Dictionary<string,SystemStats>();
    1.29 -		private string defaultStats;
    1.30 -        private int defaultArmySize;
    1.31 +        private bool allowAllies;
    1.32 +        private Dictionary<string, Category> categories = new Dictionary<string, Category>();
    1.33 +        private Dictionary<string, SystemStats> stats = new Dictionary<string, SystemStats>();
    1.34 +        private string defaultStats;
    1.35 +        private decimal defaultArmySize;
    1.36 +        private string systemPtsAbbrevSingle;
    1.37 +        private string systemPtsAbbrevPlural;
    1.38 +        private string systemPtsNameSingle;
    1.39 +        private string systemPtsNamePlural;
    1.40 +        private string pointsAbbrevSingle;
    1.41 +        private string pointsAbbrevPlural;
    1.42 +        public string pointsAbbreviation;
    1.43 +        private string pointsNameSingle;
    1.44 +        private string pointsNamePlural;
    1.45 +        public string pointsName;
    1.46  
    1.47          public GameSystem(string systemID, string systemName, IWarFoundryFactory creatingFactory)
    1.48              : base(systemID, systemName, creatingFactory)
    1.49 -		{
    1.50 -			stats = new Dictionary<string,SystemStats>();
    1.51 -		}
    1.52 +        {
    1.53 +            stats = new Dictionary<string, SystemStats>();
    1.54 +        }
    1.55  
    1.56 -        public int SystemArmyDefaultSize
    1.57 +        public decimal SystemArmyDefaultSize
    1.58          {
    1.59 -            get { return  defaultArmySize; }
    1.60 +            get { return defaultArmySize; }
    1.61              set
    1.62              {
    1.63                  if (value == 0)
    1.64 @@ -46,224 +57,383 @@
    1.65                  }
    1.66              }
    1.67          }
    1.68 -		
    1.69 -		public bool AllowAllies
    1.70 -		{
    1.71 -			get { return allowAllies; }
    1.72 -			set { allowAllies = value; }
    1.73 -		}
    1.74 -		
    1.75 -		public void AddCategory(Category cat)
    1.76 -		{
    1.77 -			RawCategories[cat.ID] = cat;
    1.78 -		}
    1.79  
    1.80 -		public Category GetCategory(string id)
    1.81 -		{
    1.82 -			EnsureFullyLoaded();
    1.83 -			Category cat = null;
    1.84 -			RawCategories.TryGetValue(id, out cat);
    1.85 -			return cat;
    1.86 -		}
    1.87 +        public string SystemPtsAbbrevSingle
    1.88 +        {
    1.89 +            get { return systemPtsAbbrevSingle; }
    1.90 +            set { systemPtsAbbrevSingle = value; }
    1.91 +        }
    1.92 +        public string SystemPtsAbbrevPlural
    1.93 +        {
    1.94 +            get { return systemPtsAbbrevPlural; }
    1.95 +            set { systemPtsAbbrevPlural = value; }
    1.96 +        }
    1.97 +        public string SystemPtsNameSingle
    1.98 +        {
    1.99 +            get { return systemPtsNameSingle; }
   1.100 +            set { systemPtsNameSingle = value; }
   1.101 +        }
   1.102 +        public string SystemPtsNamePlural
   1.103 +        {
   1.104 +            get { return systemPtsNamePlural; }
   1.105 +            set { systemPtsNamePlural = value; }
   1.106 +        }
   1.107 +        public bool AllowAllies
   1.108 +        {
   1.109 +            get { return allowAllies; }
   1.110 +            set { allowAllies = value; }
   1.111 +        }
   1.112  
   1.113 -		public Category[] Categories
   1.114 -		{
   1.115 -			get 
   1.116 -			{ 
   1.117 -				EnsureFullyLoaded();
   1.118 -				return DictionaryUtils.ToArray<string, Category>(RawCategories); 
   1.119 -			}
   1.120 -		}
   1.121 -		
   1.122 -		protected Dictionary<string, Category> RawCategories
   1.123 -		{
   1.124 -			get { return categories; }
   1.125 -		}
   1.126 +        public void AddCategory(Category cat)
   1.127 +        {
   1.128 +            RawCategories[cat.ID] = cat;
   1.129 +        }
   1.130  
   1.131 -		public bool WarnOnError
   1.132 -		{
   1.133 -			get
   1.134 -			{
   1.135 -				return warnOnError;
   1.136 -			}
   1.137 -			set { warnOnError = value; }
   1.138 -		}
   1.139 -		
   1.140 -		public void AddSystemStats(SystemStats sysStats)
   1.141 -		{
   1.142 -			stats[sysStats.ID] = sysStats;
   1.143 -		}
   1.144 -		
   1.145 -		public SystemStats StandardSystemStats
   1.146 -		{
   1.147 -			get
   1.148 -			{
   1.149 -				EnsureFullyLoaded();
   1.150 -				return stats[defaultStats];
   1.151 -			}
   1.152 -		}
   1.153 -		
   1.154 -		public string StandardSystemStatsID
   1.155 -		{
   1.156 -			get
   1.157 -			{
   1.158 -				EnsureFullyLoaded();
   1.159 -				return defaultStats;
   1.160 -			}
   1.161 -			
   1.162 -			set
   1.163 -			{
   1.164 -				if (value != null && value.Trim().Length > 0)
   1.165 -				{
   1.166 -					defaultStats = value;
   1.167 -				}
   1.168 -			}
   1.169 -		}
   1.170 +        public Category GetCategory(string id)
   1.171 +        {
   1.172 +            EnsureFullyLoaded();
   1.173 +            Category cat = null;
   1.174 +            RawCategories.TryGetValue(id, out cat);
   1.175 +            return cat;
   1.176 +        }
   1.177  
   1.178 -		public SystemStats[] SystemStats
   1.179 -		{
   1.180 -			get 
   1.181 -			{ 
   1.182 -				EnsureFullyLoaded();
   1.183 -				SystemStats[] statsArray = new SystemStats[stats.Count];
   1.184 -				stats.Values.CopyTo(statsArray, 0);
   1.185 -				return statsArray;
   1.186 -			}
   1.187 -		}
   1.188 -		
   1.189 -		public SystemStats GetSystemStatsForID(string id)
   1.190 -		{
   1.191 -			EnsureFullyLoaded();
   1.192 -			SystemStats statsForID;
   1.193 -			stats.TryGetValue(id, out statsForID);
   1.194 -			return statsForID;
   1.195 -		}
   1.196 -		
   1.197 -		public Race SystemDefaultRace
   1.198 -		{
   1.199 -			get { return WarFoundryLoader.GetDefault().GetRace(this, Race.SYSTEM_DEFAULT_RACE_ID); }
   1.200 -		}
   1.201 +        public void SetCategory(Category cat)
   1.202 +        {
   1.203 +            Category old;
   1.204 +            RawCategories.TryGetValue(cat.ID, out old);
   1.205  
   1.206 -		public bool Matches(GameSystem otherSystem)
   1.207 -		{
   1.208 -			if (otherSystem==null)
   1.209 -			{
   1.210 -				return false;
   1.211 -			}
   1.212 +            if (old == null)
   1.213 +            {
   1.214 +                AddCategory(cat);
   1.215 +            }
   1.216 +            else
   1.217 +            {
   1.218 +                if (!old.Equals(cat))
   1.219 +                {
   1.220 +                    RawCategories[old.ID] = cat;
   1.221 +                }
   1.222 +            }
   1.223 +        }
   1.224  
   1.225 -			return this.ID == otherSystem.ID;
   1.226 -		}
   1.227 +        public void RemoveCategory(string id)
   1.228 +        {
   1.229 +            RawCategories.Remove(id);
   1.230 +        }
   1.231  
   1.232 -		public override bool Equals(object obj)
   1.233 -		{
   1.234 -			if (obj == null)
   1.235 -			{
   1.236 -				return false;		
   1.237 -			}
   1.238 -			
   1.239 -			if (obj.GetType().Equals(this.GetType()))
   1.240 -			{
   1.241 -				GameSystem otherSystem = (GameSystem)obj;
   1.242 +        public Category[] Categories
   1.243 +        {
   1.244 +            get
   1.245 +            {
   1.246 +                EnsureFullyLoaded();
   1.247 +                return DictionaryUtils.ToArray<string, Category>(RawCategories);
   1.248 +            }
   1.249 +        }
   1.250  
   1.251 -				return this.ID == otherSystem.ID && this.Name == otherSystem.Name && ((this.RawCategories == null && otherSystem.RawCategories == null) || this.RawCategories.Equals(otherSystem.RawCategories));
   1.252 -			}
   1.253 -			else
   1.254 -			{
   1.255 -				return false;
   1.256 -			}
   1.257 -		}
   1.258 +        protected Dictionary<string, Category> RawCategories
   1.259 +        {
   1.260 +            get { return categories; }
   1.261 +        }
   1.262  
   1.263 -		public override int GetHashCode()
   1.264 -		{
   1.265 -			return ID.GetHashCode() + Name.GetHashCode() + (RawCategories!=null ? RawCategories.GetHashCode() : 0) + warnOnError.GetHashCode();
   1.266 -		}
   1.267 +        public bool WarnOnError
   1.268 +        {
   1.269 +            get
   1.270 +            {
   1.271 +                return warnOnError;
   1.272 +            }
   1.273 +            set { warnOnError = value; }
   1.274 +        }
   1.275  
   1.276 -		public bool UnitTypeMaxed(UnitType unitType, Army army)
   1.277 -		{
   1.278 -			return unitType.MaxNumber!=WarFoundryCore.INFINITY && army.GetUnitTypeCount(unitType) >= unitType.MaxNumber;
   1.279 -		}
   1.280 +        public void AddSystemStats(SystemStats sysStats)
   1.281 +        {
   1.282 +            stats[sysStats.ID] = sysStats;
   1.283 +        }
   1.284  
   1.285 -		public bool UnitTypeMinned(UnitType unitType, Army army)
   1.286 -		{
   1.287 -			return army.GetUnitTypeCount(unitType) <= unitType.MinNumber;
   1.288 -		}
   1.289 -		
   1.290 -		public List<EquipmentItem> GetSystemEquipmentList()
   1.291 -		{
   1.292 -			List<EquipmentItem> items = new List<EquipmentItem>();
   1.293 -			Race defaultRace = SystemDefaultRace;
   1.294 -			
   1.295 -			if (defaultRace!=null)
   1.296 -			{				
   1.297 -				items = defaultRace.GetEquipmentList();
   1.298 -			}
   1.299 -			
   1.300 -			return items;
   1.301 -		}
   1.302 -				
   1.303 -		public EquipmentItem GetSystemEquipmentItem(string id)
   1.304 -		{
   1.305 -			EquipmentItem item = null;
   1.306 -			Race defaultRace = SystemDefaultRace;
   1.307 -			
   1.308 -			if (defaultRace!=null)
   1.309 -			{				
   1.310 -				item = defaultRace.GetEquipmentItem(id);
   1.311 -			}
   1.312 -			
   1.313 -			return item;
   1.314 -		}
   1.315 -		
   1.316 -		public UnitType[] GetSystemUnitTypes(Category cat)
   1.317 -		{
   1.318 -			UnitType[] items = new UnitType[0];
   1.319 -			Race defaultRace = SystemDefaultRace;
   1.320 -			
   1.321 -			if (defaultRace!=null)
   1.322 -			{				
   1.323 -				items = defaultRace.GetUnitTypes(cat);
   1.324 -			}
   1.325 -			
   1.326 -			return items;
   1.327 -		}
   1.328 -				
   1.329 -		public UnitType GetSystemUnitType(string id)
   1.330 -		{
   1.331 -			UnitType unit = null;
   1.332 -			Race defaultRace = SystemDefaultRace;
   1.333 -			
   1.334 -			if (defaultRace!=null)
   1.335 -			{				
   1.336 -				unit = defaultRace.GetUnitType(id);
   1.337 -			}
   1.338 -			
   1.339 -			return unit;
   1.340 -		}
   1.341 -		
   1.342 -		public List<Ability> GetSystemAbilityList()
   1.343 -		{
   1.344 -			List<Ability> items = new List<Ability>();
   1.345 -			Race defaultRace = SystemDefaultRace;
   1.346 -			
   1.347 -			if (defaultRace!=null)
   1.348 -			{				
   1.349 -				items = defaultRace.GetAbilityList();
   1.350 -			}
   1.351 -			
   1.352 -			return items;
   1.353 -		}
   1.354 -				
   1.355 -		public Ability GetSystemAbility(string id)
   1.356 -		{
   1.357 -			Ability ability = null;
   1.358 -			Race defaultRace = SystemDefaultRace;
   1.359 -			
   1.360 -			if (defaultRace!=null)
   1.361 -			{				
   1.362 -				ability = defaultRace.GetAbility(id);
   1.363 -			}
   1.364 -			
   1.365 -			return ability;
   1.366 -		}
   1.367 -	}
   1.368 +        public SystemStats StandardSystemStats
   1.369 +        {
   1.370 +            get
   1.371 +            {
   1.372 +                EnsureFullyLoaded();
   1.373 +                return stats[defaultStats];
   1.374 +            }
   1.375 +        }
   1.376 +
   1.377 +        public string StandardSystemStatsID
   1.378 +        {
   1.379 +            get
   1.380 +            {
   1.381 +                EnsureFullyLoaded();
   1.382 +                return defaultStats;
   1.383 +            }
   1.384 +
   1.385 +            set
   1.386 +            {
   1.387 +                if (value != null && value.Trim().Length > 0)
   1.388 +                {
   1.389 +                    defaultStats = value;
   1.390 +                }
   1.391 +            }
   1.392 +        }
   1.393 +
   1.394 +        public SystemStats[] SystemStats
   1.395 +        {
   1.396 +            get
   1.397 +            {
   1.398 +                EnsureFullyLoaded();
   1.399 +                SystemStats[] statsArray = new SystemStats[stats.Count];
   1.400 +                stats.Values.CopyTo(statsArray, 0);
   1.401 +                return statsArray;
   1.402 +            }
   1.403 +        }
   1.404 +
   1.405 +        public SystemStats GetSystemStatsForID(string id)
   1.406 +        {
   1.407 +            EnsureFullyLoaded();
   1.408 +            SystemStats statsForID;
   1.409 +            stats.TryGetValue(id, out statsForID);
   1.410 +            return statsForID;
   1.411 +        }
   1.412 +
   1.413 +        public void SetSystemStats(SystemStats newStats)
   1.414 +        {
   1.415 +            SystemStats old;
   1.416 +            stats.TryGetValue(newStats.ID, out old);
   1.417 +
   1.418 +            if (old == null)
   1.419 +            {
   1.420 +                AddSystemStats(newStats);
   1.421 +            }
   1.422 +            else
   1.423 +            {
   1.424 +                if (!old.Equals(newStats))
   1.425 +                {
   1.426 +                    stats[old.ID] = newStats;
   1.427 +                }
   1.428 +            }
   1.429 +        }
   1.430 +
   1.431 +        public void RemoveSystemStats(string id)
   1.432 +        {
   1.433 +            stats.Remove(id);
   1.434 +        }
   1.435 +
   1.436 +        public Race SystemDefaultRace
   1.437 +        {
   1.438 +            get { return WarFoundryLoader.GetDefault().GetRace(this, Race.SYSTEM_DEFAULT_RACE_ID); }
   1.439 +        }
   1.440 +
   1.441 +        public bool Matches(GameSystem otherSystem)
   1.442 +        {
   1.443 +            if (otherSystem == null)
   1.444 +            {
   1.445 +                return false;
   1.446 +            }
   1.447 +
   1.448 +            return this.ID == otherSystem.ID;
   1.449 +        }
   1.450 +
   1.451 +        public override bool Equals(object obj)
   1.452 +        {
   1.453 +            if (obj == null)
   1.454 +            {
   1.455 +                return false;
   1.456 +            }
   1.457 +
   1.458 +            if (obj.GetType().Equals(this.GetType()))
   1.459 +            {
   1.460 +                GameSystem otherSystem = (GameSystem)obj;
   1.461 +
   1.462 +                return this.ID == otherSystem.ID && this.Name == otherSystem.Name && ((this.RawCategories == null && otherSystem.RawCategories == null) || this.RawCategories.Equals(otherSystem.RawCategories));
   1.463 +            }
   1.464 +            else
   1.465 +            {
   1.466 +                return false;
   1.467 +            }
   1.468 +        }
   1.469 +
   1.470 +        public override int GetHashCode()
   1.471 +        {
   1.472 +            return ID.GetHashCode() + Name.GetHashCode() + (RawCategories != null ? RawCategories.GetHashCode() : 0) + warnOnError.GetHashCode();
   1.473 +        }
   1.474 +
   1.475 +        public bool UnitTypeMaxed(UnitType unitType, Army army)
   1.476 +        {
   1.477 +            return unitType.MaxNumber != WarFoundryCore.INFINITY && army.GetUnitTypeCount(unitType) >= unitType.MaxNumber;
   1.478 +        }
   1.479 +
   1.480 +        public bool UnitTypeMinned(UnitType unitType, Army army)
   1.481 +        {
   1.482 +            return army.GetUnitTypeCount(unitType) <= unitType.MinNumber;
   1.483 +        }
   1.484 +
   1.485 +        public List<EquipmentItem> GetSystemEquipmentList()
   1.486 +        {
   1.487 +            List<EquipmentItem> items = new List<EquipmentItem>();
   1.488 +            Race defaultRace = SystemDefaultRace;
   1.489 +
   1.490 +            if (defaultRace != null)
   1.491 +            {
   1.492 +                items = defaultRace.GetEquipmentList();
   1.493 +            }
   1.494 +
   1.495 +            return items;
   1.496 +        }
   1.497 +
   1.498 +        public EquipmentItem GetSystemEquipmentItem(string id)
   1.499 +        {
   1.500 +            EquipmentItem item = null;
   1.501 +            Race defaultRace = SystemDefaultRace;
   1.502 +
   1.503 +            if (defaultRace != null)
   1.504 +            {
   1.505 +                item = defaultRace.GetEquipmentItem(id);
   1.506 +            }
   1.507 +
   1.508 +            return item;
   1.509 +        }
   1.510 +
   1.511 +        public UnitType[] GetSystemUnitTypes(Category cat)
   1.512 +        {
   1.513 +            UnitType[] items = new UnitType[0];
   1.514 +            Race defaultRace = SystemDefaultRace;
   1.515 +
   1.516 +            if (defaultRace != null)
   1.517 +            {
   1.518 +                items = defaultRace.GetUnitTypes(cat);
   1.519 +            }
   1.520 +
   1.521 +            return items;
   1.522 +        }
   1.523 +
   1.524 +        public UnitType GetSystemUnitType(string id)
   1.525 +        {
   1.526 +            UnitType unit = null;
   1.527 +            Race defaultRace = SystemDefaultRace;
   1.528 +
   1.529 +            if (defaultRace != null)
   1.530 +            {
   1.531 +                unit = defaultRace.GetUnitType(id);
   1.532 +            }
   1.533 +
   1.534 +            return unit;
   1.535 +        }
   1.536 +
   1.537 +        public List<Ability> GetSystemAbilityList()
   1.538 +        {
   1.539 +            List<Ability> items = new List<Ability>();
   1.540 +            Race defaultRace = SystemDefaultRace;
   1.541 +
   1.542 +            if (defaultRace != null)
   1.543 +            {
   1.544 +                items = defaultRace.GetAbilityList();
   1.545 +            }
   1.546 +
   1.547 +            return items;
   1.548 +        }
   1.549 +
   1.550 +        public Ability GetSystemAbility(string id)
   1.551 +        {
   1.552 +            Ability ability = null;
   1.553 +            Race defaultRace = SystemDefaultRace;
   1.554 +
   1.555 +            if (defaultRace != null)
   1.556 +            {
   1.557 +                ability = defaultRace.GetAbility(id);
   1.558 +            }
   1.559 +
   1.560 +            return ability;
   1.561 +        }
   1.562 +        public string UsePointsAbbrev(double pointTemp)
   1.563 +        {
   1.564 +            if (pointTemp == 1)
   1.565 +            {
   1.566 +                pointsAbbreviation = pointsAbbrevSingle;
   1.567 +            }
   1.568 +            else
   1.569 +            {
   1.570 +                pointsAbbreviation = pointsAbbrevPlural;
   1.571 +            }
   1.572 +            return pointsAbbreviation;
   1.573 +        }
   1.574 +
   1.575 +        public string UsePointsName(double pointTemp)
   1.576 +        {
   1.577 +
   1.578 +            if (pointTemp == 1)
   1.579 +            {
   1.580 +                pointsName = pointsNameSingle;
   1.581 +            }
   1.582 +            else
   1.583 +            {
   1.584 +                pointsName = pointsNamePlural;
   1.585 +            }
   1.586 +            return pointsName;
   1.587 +        }
   1.588 +        public void LoadPointsSystemNames()
   1.589 +        {
   1.590 +            if (this != null)
   1.591 +            {
   1.592 +                LoadPointsAbbrevPlural();
   1.593 +                LoadPointsAbbrevSingle();
   1.594 +                LoadPointsNamePlural();
   1.595 +                LoadPointsNameSingle();
   1.596 +            }
   1.597 +        }
   1.598 +        private void LoadPointsAbbrevPlural()
   1.599 +        {
   1.600 +            // Use this before calling on pointsAbbreviationPlural to "populate" the variable
   1.601 +
   1.602 +            if (SystemPtsAbbrevPlural == "")
   1.603 +            {
   1.604 +                pointsAbbrevPlural = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevPlural"));
   1.605 +            }
   1.606 +            else
   1.607 +            {
   1.608 +                pointsAbbrevPlural = SystemPtsAbbrevPlural;
   1.609 +            }
   1.610 +
   1.611 +        }
   1.612 +        private void LoadPointsAbbrevSingle()
   1.613 +        {
   1.614 +            // Use this before calling on pointsAbbreviationSingle to "populate" the variable
   1.615 +            if (SystemPtsAbbrevSingle == "")
   1.616 +            {
   1.617 +                pointsAbbrevSingle = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevSingle"));
   1.618 +            }
   1.619 +            else
   1.620 +            {
   1.621 +                pointsAbbrevSingle = SystemPtsAbbrevSingle;
   1.622 +            }
   1.623 +        }
   1.624 +        private void LoadPointsNamePlural()
   1.625 +        {
   1.626 +            // Use this before calling on pointsNamePlural to "populate" the variable
   1.627 +            if (SystemPtsNamePlural == "")
   1.628 +            {
   1.629 +                pointsNamePlural = String.Format(Translation.GetTranslation("PointsLocalisationNamePlural"));
   1.630 +            }
   1.631 +            else
   1.632 +            {
   1.633 +                pointsNamePlural = SystemPtsNamePlural;
   1.634 +            }
   1.635 +
   1.636 +        }
   1.637 +
   1.638 +        private void LoadPointsNameSingle()
   1.639 +        {
   1.640 +            // Use this before calling on pointsNameSingle to "populate" the variable
   1.641 +            if (SystemPtsNameSingle == "")
   1.642 +            {
   1.643 +                pointsNameSingle = String.Format(Translation.GetTranslation("PointsLocalisationNameSingle"));
   1.644 +            }
   1.645 +            else
   1.646 +            {
   1.647 +                pointsNameSingle = SystemPtsNameSingle;
   1.648 +            }
   1.649 +        }
   1.650 +
   1.651 +        public string setUnitEquipmentItemName(string itemName,double pointsTemp)
   1.652 +        {
   1.653 +            return itemName + Translation.GetTranslation("setUnitEquipmentItemName", "({0}pts each)", pointsTemp, UsePointsAbbrev(pointsTemp));
   1.654 +        }
   1.655 +    }
   1.656  }