changeset 11:4e5e382fbd2e

Re #10 (Code readability) and Re #86 (Complete GTK# GUI): * Update UnitDisplayWidget to use new way of getting unit stats
author IBBoard <dev@ibboard.co.uk>
date Wed, 27 May 2009 19:44:40 +0000
parents c687bbe901f8
children 685532d43a96
files Widgets/UnitDisplayWidget.cs
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/Widgets/UnitDisplayWidget.cs	Thu Apr 09 15:33:33 2009 +0000
     1.2 +++ b/Widgets/UnitDisplayWidget.cs	Wed May 27 19:44:40 2009 +0000
     1.3 @@ -43,13 +43,13 @@
     1.4  		{
     1.5              //GameSystem system = unit.Army.GameSystem;
     1.6              //SystemStats stats = system.StandardSystemStats;
     1.7 -            Stats stats = unit.UnitType.UnitStats;
     1.8              CellRendererText renderer = new CellRendererText();
     1.9              unitStats.AppendColumn(Translation.GetTranslation("UnitNameColumn", "Unit Type", null), renderer, new TreeCellDataFunc(RenderUnitName));
    1.10              
    1.11 -            TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat);
    1.12 +            TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat);
    1.13 +            Stat[] stats = unit.UnitStatsArray;
    1.14  			
    1.15 -			int length = stats.StatCount;
    1.16 +			int length = stats.Length;
    1.17  
    1.18  			for (int i = 0; i < length; i++)
    1.19  			{
    1.20 @@ -79,8 +79,7 @@
    1.21  			if (o is IBBoard.WarFoundry.API.Objects.Unit)
    1.22  			{
    1.23  				IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o;
    1.24 -				//TODO Check for correct value based on the column
    1.25 -				(cell as CellRendererText).Text = u.UnitStats[column.Title].SlotValueString;
    1.26 +				(cell as CellRendererText).Text = u.GetStatValue(column.Title);
    1.27  			}
    1.28  		}
    1.29