Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison api/Util/UnitEquipmentUtil.cs @ 188:354d51cc002b
Re #198: Add equipment slots
* Pass tests
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 27 Oct 2009 20:58:10 +0000 |
parents | 104a683b5ef8 |
children | 0b413f41e6e3 |
comparison
equal
deleted
inserted
replaced
187:104a683b5ef8 | 188:354d51cc002b |
---|---|
140 | 140 |
141 if (equip.IsRatioLimit) | 141 if (equip.IsRatioLimit) |
142 { | 142 { |
143 limit = Math.Max(((IPercentageLimit)equip.MinLimit).Percentage, ((IPercentageLimit)equip.MaxLimit).Percentage); | 143 limit = Math.Max(((IPercentageLimit)equip.MinLimit).Percentage, ((IPercentageLimit)equip.MaxLimit).Percentage); |
144 } | 144 } |
145 else | |
146 { | |
147 int unitSize = unit.Size; | |
148 limit = (equip.MaxLimit.GetLimit(unitSize) / (double)unitSize) * 100.0; | |
149 } | |
145 | 150 |
146 return limit; | 151 return limit; |
147 } | 152 } |
148 } | 153 } |
149 } | 154 } |