comparison API/Objects/UnitMemberType.cs @ 337:3c4a6403a88c

* Fix capitalisation so that new files are in the namespace no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 03 Apr 2011 18:50:32 +0000
parents
children
comparison
equal deleted inserted replaced
336:3631c1493c7f 337:3c4a6403a88c
1 // This file (UnitMember.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2010 IBBoard
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
5 using System;
6
7 namespace IBBoard.WarFoundry.API.Objects
8 {
9 /// <summary>
10 /// A container object for representations of different unit member types, such as "Infantry", "Elite Infantry" and "Commoner".
11 /// The idea of the UnitMemberType is to define not just the <see>UnitType</see>s, but also the types of type, as Archer and Swordsmen
12 /// are often just differently equipped versions of the same member type (Infantry).
13 /// </summary>
14 public class UnitMemberType : WarFoundryObject
15 {
16 private Stats stats;
17
18 public UnitMemberType(string typeID, string typeName, Stats typeStats) : base(typeID, typeName)
19 {
20 stats = typeStats;
21 }
22
23 public string StatsID
24 {
25 get
26 {
27 return stats.StatsID;
28 }
29 }
30
31 /// <value>
32 /// The set of <see cref="Stat"/>s for the unit member type in a format that is valid for the game system.
33 /// </value>
34 public Stat[] StatsArray
35 {
36 get
37 {
38 return stats.StatsArray;
39 }
40 }
41
42 public Stat[] StatsArrayWithName
43 {
44 get
45 {
46 Stat[] extendedStats = new Stat[stats.StatCount+1];
47 extendedStats[0] = new Stat(new StatSlot("name"), Name);
48 stats.StatsArray.CopyTo(extendedStats, 1);
49 return extendedStats;
50 }
51 }
52 }
53 }