0
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3
|
|
4 namespace IBBoard.WarFoundry.API.Objects
|
|
5 {
|
|
6 /// <summary>
|
10
|
7 /// SystemStats defines the available statistics/attributes that entity types can use (either a unit or an equipment item that has a stats line). Statistic/attribute values will be defined by a <see cref="Stats"/> object.
|
0
|
8 /// </summary>
|
|
9 public class SystemStats
|
|
10 {
|
|
11 private Dictionary<string, StatSlot> stats;
|
|
12 private string id;
|
|
13
|
|
14 public SystemStats(string statsID, StatSlot[] statSlots)
|
|
15 {
|
|
16 id = statsID;
|
|
17 stats = new Dictionary<string, StatSlot>();
|
|
18
|
|
19 foreach (StatSlot slot in statSlots)
|
|
20 {
|
|
21 slot.SystemStats = this;
|
|
22 stats[slot.Name] = slot;
|
|
23 }
|
|
24 }
|
|
25
|
|
26 public StatSlot[] StatSlots
|
|
27 {
|
|
28 get
|
|
29 {
|
|
30 StatSlot[] slots = new StatSlot[stats.Count];
|
|
31 stats.Values.CopyTo(slots, 0);
|
|
32 return slots;
|
|
33 }
|
|
34 }
|
|
35
|
|
36 public StatSlot this[string key]
|
|
37 {
|
|
38 get
|
|
39 {
|
|
40 StatSlot slot = null;
|
|
41 stats.TryGetValue(key, out slot);
|
|
42 return slot;
|
|
43 }
|
|
44 }
|
|
45
|
|
46 public int SlotCount
|
|
47 {
|
|
48 get { return stats.Count; }
|
|
49 }
|
|
50
|
|
51 public string ID
|
|
52 {
|
|
53 get { return id; }
|
|
54 }
|
|
55 }
|
|
56 }
|