comparison api/Objects/Race.cs @ 383:8981fc45fe17 default-army-name

Re #153: Default name for armies Hopefully API code added as well
author snowblizz
date Tue, 07 Sep 2010 11:53:22 +0000
parents 3b395ab8784d
children b21a85c079f5
comparison
equal deleted inserted replaced
281:c035afa4a42c 383:8981fc45fe17
15 { 15 {
16 public static string SYSTEM_DEFAULT_RACE_ID = "GameDefault"; 16 public static string SYSTEM_DEFAULT_RACE_ID = "GameDefault";
17 17
18 private string subID; 18 private string subID;
19 private GameSystem system; 19 private GameSystem system;
20 private string defaultArmyName;
20 private Dictionary<Category, Dictionary<string, UnitType>> unitTypesByCat; 21 private Dictionary<Category, Dictionary<string, UnitType>> unitTypesByCat;
21 private Dictionary<string, UnitType> unitTypes = new Dictionary<string,UnitType>(); 22 private Dictionary<string, UnitType> unitTypes = new Dictionary<string,UnitType>();
22 private Dictionary<string, EquipmentItem> equipment = new Dictionary<string,EquipmentItem>(); 23 private Dictionary<string, EquipmentItem> equipment = new Dictionary<string,EquipmentItem>();
23 private Dictionary<string, Ability> abilities = new Dictionary<string,Ability>(); 24 private Dictionary<string, Ability> abilities = new Dictionary<string,Ability>();
24 private Dictionary<string, Category> categories = new Dictionary<string,Category>(); 25 private Dictionary<string, Category> categories = new Dictionary<string,Category>();
25 private Dictionary<string, UnitMemberType> memberTypes = new Dictionary<string, UnitMemberType>(); 26 private Dictionary<string, UnitMemberType> memberTypes = new Dictionary<string, UnitMemberType>();
26 27
27 public Race(string raceID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : this(raceID, "", raceName, gameSystem, creatingFactory) 28 public Race(string raceID, string raceName, string raceArmyName, GameSystem gameSystem, IWarFoundryFactory creatingFactory)
28 { 29 : this(raceID, "", raceName, raceArmyName, gameSystem, creatingFactory)
29 } 30 {
30 31 }
31 public Race(string raceID, string raceSubID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : base(raceID + (raceSubID!="" ? "_"+raceSubID : ""), raceName, creatingFactory) 32
33 public Race(string raceID, string raceSubID, string raceName, string raceArmyName, GameSystem gameSystem, IWarFoundryFactory creatingFactory)
34 : base(raceID + (raceSubID != "" ? "_" + raceSubID : ""), raceName, creatingFactory)
32 { 35 {
33 subID = (raceSubID == null ? "" : raceSubID); 36 subID = (raceSubID == null ? "" : raceSubID);
34 system = gameSystem; 37 system = gameSystem;
35 } 38 }
36 39
51 } 54 }
52 55
53 system = value; 56 system = value;
54 } 57 }
55 } 58 }
56 59
60 public string ArmyDefaultName
61 {
62 get {
63
64 //throw new ArgumentException("No default army name");
65 System.Diagnostics.Debug.WriteLine(defaultArmyName + "&No default army name");
66
67 return defaultArmyName = "test";
68 }
69 set
70 {
71 if (value == null)
72 {
73 //throw new ArgumentException("No default army name");
74 System.Diagnostics.Debug.WriteLine(defaultArmyName + "&No default army name");
75 }
76
77 defaultArmyName = "testSet";
78 }
79 }
57 public void AddCategory(Category cat) 80 public void AddCategory(Category cat)
58 { 81 {
59 categories[cat.ID] = cat; 82 categories[cat.ID] = cat;
60 } 83 }
61 84