# HG changeset patch # User IBBoard # Date 1302376451 0 # Node ID 12a56786120c325e64ed733dcc4eb243180314ed # Parent d34ae0057a3996f13ec71c9cf62dee1f59b7f01e Re #27: Unit requirements * Implement getting all requirements from unit types of race diff -r d34ae0057a39 -r 12a56786120c API/Objects/Race.cs --- 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 GetRequirements () + public ICollection GetRequirements() { ICollection reqs = new List(); + + foreach (UnitType unitType in unitTypes.Values) + { + foreach (IRequirement requirement in unitType.GetRequirements()) + { + reqs.Add(requirement); + } + } + return reqs; } }