Mercurial > repos > snowblizz-super-API-ideas
annotate API/Factories/Requirement/UnitRequiresAtLeastNUnitsRequirementFactory.cs @ 372:2f8b2467ba99
Re #351: Add extensible requirement handling method
* Pass unit test (assumes units are already loaded)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 14 Jun 2011 13:58:16 +0000 |
parents | bfdb95906075 |
children | e10630f39ec2 |
rev | line source |
---|---|
371
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (UnitRequiresAtLeastNUnitsRequirementFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 // 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. |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 using System; |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using IBBoard.WarFoundry.API.Objects; |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using IBBoard.WarFoundry.API.Objects.Requirement; |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.WarFoundry.API.Factories.Requirement |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 public class UnitRequiresAtLeastNUnitsRequirementFactory |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 { |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 public UnitRequiresAtLeastNUnitsRequirementFactory() |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 { |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 //Do nothing special |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 } |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 public UnitRequiresAtLeastNUnitsRequirement CreateRequirement (UnitType type, string data) |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 { |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 UnitRequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(type); |
372
2f8b2467ba99
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
371
diff
changeset
|
20 req.AddUnitTypeRequirement(type.Race.GetUnitType(data)); |
371
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 return req; |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 } |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 } |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 } |
bfdb95906075
Re #351: Add extensible requirement handling method
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 |