Mercurial > repos > IBBoard.WarFoundry.API
changeset 349:12a56786120c
Re #27: Unit requirements
* Implement getting all requirements from unit types of race
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 09 Apr 2011 19:14:11 +0000 |
parents | d34ae0057a39 |
children | 6c0404277cad |
files | API/Objects/Race.cs |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/API/Objects/Race.cs Sat Apr 09 16:01:02 2011 +0000 +++ b/API/Objects/Race.cs Sat Apr 09 19:14:11 2011 +0000 @@ -1,7 +1,6 @@ // This file (Race.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard. // // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - using System; using System.Collections.Generic; using System.IO; @@ -306,9 +305,18 @@ } } - public ICollection<IRequirement> GetRequirements () + public ICollection<IRequirement> GetRequirements() { ICollection<IRequirement> reqs = new List<IRequirement>(); + + foreach (UnitType unitType in unitTypes.Values) + { + foreach (IRequirement requirement in unitType.GetRequirements()) + { + reqs.Add(requirement); + } + } + return reqs; } }