Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
diff Widgets/UnitDisplayWidget.cs @ 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 | 65279b85446f |
children | 6b2c8e55564a |
line wrap: on
line diff
--- a/Widgets/UnitDisplayWidget.cs Thu Apr 09 15:33:33 2009 +0000 +++ b/Widgets/UnitDisplayWidget.cs Wed May 27 19:44:40 2009 +0000 @@ -43,13 +43,13 @@ { //GameSystem system = unit.Army.GameSystem; //SystemStats stats = system.StandardSystemStats; - Stats stats = unit.UnitType.UnitStats; CellRendererText renderer = new CellRendererText(); unitStats.AppendColumn(Translation.GetTranslation("UnitNameColumn", "Unit Type", null), renderer, new TreeCellDataFunc(RenderUnitName)); - TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat); + TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat); + Stat[] stats = unit.UnitStatsArray; - int length = stats.StatCount; + int length = stats.Length; for (int i = 0; i < length; i++) { @@ -79,8 +79,7 @@ if (o is IBBoard.WarFoundry.API.Objects.Unit) { IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o; - //TODO Check for correct value based on the column - (cell as CellRendererText).Text = u.UnitStats[column.Title].SlotValueString; + (cell as CellRendererText).Text = u.GetStatValue(column.Title); } }