diff api/Commands/RemoveUnitCommand.cs @ 215:391446c9b250

Re #223: Use translations within the API * Translate and cache undo/redo descriptions of commands * Simplify "set equipment amount" descriptions because of ticket:224 Also: * Line ending change on ICostedWarFoundryObject
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Nov 2009 20:08:45 +0000
parents 2f3cafb69799
children 650bbe79b884
line wrap: on
line diff
--- a/api/Commands/RemoveUnitCommand.cs	Sat Nov 21 21:27:07 2009 +0000
+++ b/api/Commands/RemoveUnitCommand.cs	Sun Nov 22 20:08:45 2009 +0000
@@ -4,6 +4,7 @@
 
 using System;
 using IBBoard.Commands;
+using IBBoard.Lang;
 using IBBoard.WarFoundry.API.Objects;
 
 namespace IBBoard.WarFoundry.API.Commands
@@ -15,6 +16,8 @@
 	{
 		private Unit unit;
 		private ArmyCategory cat;
+		private string description;
+		private string undoDescription;
 
 		public RemoveUnitCommand(Unit toRemove)
 		{
@@ -29,12 +32,28 @@
 
 		public override string Description
 		{
-			get { return "Remove an existing unit from the army"; }
+			get
+			{
+				if (description == null)
+				{
+					description = Translation.GetTranslation("removeUnitCommandDescription", "remove {0} from the army", unit.Name);
+				}
+				
+				return description;
+			}
 		}
 
 		public override string UndoDescription
 		{
-			get { return "Replace a removed unit"; }
+			get
+			{
+				if (undoDescription == null)
+				{
+					undoDescription = Translation.GetTranslation("removeUnitCommandUndoDescription", "re-add {0} to the army", unit.Name);
+				}
+				
+				return undoDescription;
+			}
 		}
 
 		public override bool Execute()