Mercurial > repos > IBBoard.WarFoundry.API
annotate API/Objects/Requirement/IRequirement.cs @ 364:0dd8dbe8afe9
Fixes #345: Add failure message to requirements
* Add implementation of failure messages for "allows adding"
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 May 2011 19:17:40 +0000 |
parents | dbe7ccb1e557 |
children | 8f5125740316 |
rev | line source |
---|---|
358
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
1 // This file (Requirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard |
347 | 2 // |
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. | |
4 using System; | |
5 | |
6 namespace IBBoard.WarFoundry.API.Objects.Requirement | |
358
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
7 { |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
8 /// <summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
9 /// Base interface for a Requirement that constrains the units/equipment that can be taken in an army |
347 | 10 /// </summary> |
11 public interface IRequirement | |
358
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
12 { |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
13 /// <summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
14 /// Checks whether the supplied WarFoundryObject can be added to the supplied army. |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
15 /// </summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
16 /// <returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
17 /// A <code>Validation</code> enum to show the result of the validation |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
18 /// </returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
19 /// <param name='wfObject'> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
20 /// The object that we want to add. This may be involved in the check, or it may not affect the evaluation of the requirement |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
21 /// </param> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
22 /// <param name='toArmy'> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
23 /// The army to add the object to. |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
24 /// </param> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
25 Validation AllowsAdding(WarFoundryObject wfObject, Army toArmy); |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
26 |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
27 /// <summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
28 /// Checks whether the supplied army is currently valid according to this requirement. |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
29 /// </summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
30 /// <returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
31 /// A <code>Validation</code> enum to show the result of the validation |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
32 /// </returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
33 /// <param name='toValidate'> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
34 /// The army to validate |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
35 /// </param> |
347 | 36 Validation ValidatesArmy(Army army); |
358
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
37 |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
38 /// <summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
39 /// Gets the validation message from validating the army |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
40 /// </summary> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
41 /// <returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
42 /// A validation message, if the validation fails, else an empty string. |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
43 /// </returns> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
44 /// <param name='army'> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
45 /// The army to validate. |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
46 /// </param> |
dbe7ccb1e557
Re #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
347
diff
changeset
|
47 string GetValidationMessage(Army army); |
364
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
48 |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
49 /// <summary> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
50 /// Gets the validation message for adding a unit to the army |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
51 /// </summary> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
52 /// <returns> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
53 /// A validation message, if the type cannot be added, else an empty string. |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
54 /// </returns> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
55 /// <param name='toAdd'> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
56 /// The unit type to try to add |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
57 /// </param> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
58 /// <param name='toArmy'> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
59 /// The army the unit will be added to |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
60 /// </param> |
0dd8dbe8afe9
Fixes #345: Add failure message to requirements
IBBoard <dev@ibboard.co.uk>
parents:
358
diff
changeset
|
61 string GetAllowsAddingMessage(UnitType toAdd, Army toArmy); |
347 | 62 } |
63 } | |
64 |