Mercurial > repos > IBDev-IBBoard.WarFoundry.API
annotate api/Requirements/RequirementAND.cs @ 390:4e0031339bcb default-army-name
Re #97: Default army size papercut.
Updated GameSystem.cs, system.xsd and Factories to accommodate default system size.
author | snowblizz |
---|---|
date | Sun, 12 Dec 2010 15:27:07 +0000 |
parents | 6083010a005c |
children |
rev | line source |
---|---|
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
1 // This file (RequirementAND.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard. |
15 | 2 // |
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
82
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. |
15 | 4 |
0 | 5 using System; |
6 using System.Collections.Generic; | |
7 using IBBoard.Lang; | |
82 | 8 using IBBoard.WarFoundry.API.Objects; |
9 | |
10 namespace IBBoard.WarFoundry.API.Requirements | |
11 { | |
12 /// <summary> | |
13 /// Summary description for RequirementAND. | |
14 /// </summary> | |
15 public class RequirementAND : AbstractRequirement | |
16 { | |
229
6083010a005c
Re #223: Use translations within the API
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
17 private static string and = Translation.GetTranslation("requirementAND", "{0} and {1}"); |
82 | 18 |
19 private AbstractRequirement reqA, reqB; | |
20 | |
21 public RequirementAND(AbstractRequirement requirementA, AbstractRequirement requirementB) | |
22 { | |
23 reqA = requirementA; | |
24 reqB = requirementB; | |
25 } | |
26 | |
27 public override AbstractFailedRequirement CanAddToWarFoundryObject(WarFoundryObject obj) | |
0 | 28 { |
29 FailedRequirement failed = null; | |
82 | 30 |
0 | 31 if (reqA.CanAddToWarFoundryObject(obj) !=null || reqB.CanAddToWarFoundryObject(obj)!=null) |
32 { | |
33 failed = new FailedRequirement(this); | |
34 } | |
35 | |
82 | 36 return failed; |
37 } | |
38 | |
39 public override AbstractFailedRequirement CanRemoveFromWarFoundryObject(WarFoundryObject obj) | |
0 | 40 { |
41 FailedRequirement failed = null; | |
82 | 42 |
0 | 43 if (reqA.CanRemoveFromWarFoundryObject(obj) !=null || reqB.CanRemoveFromWarFoundryObject(obj)!=null) |
44 { | |
45 failed = new FailedRequirement(this); | |
46 } | |
47 | |
82 | 48 return failed; |
49 } | |
50 | |
51 public override string Description | |
52 { | |
53 get { return String.Format(and, reqA.Description, reqB.Description); } | |
54 } | |
55 } | |
56 } |