getPurchasedProperty() public method

public getPurchasedProperty ( string name ) : PurchasedProperty
name string
return PurchasedProperty
示例#1
0
 private void newCharacter()
 {
     // default human
     var character = new GurpsCharacter(database);
     character.getPurchasedProperty("Human").PurchasedLevels = 1;
     setCharacter(character);
     filePath = null;
     savedName = null;
     Dirty = false;
     setTitle();
     Preferences.Instance.RecentCharacter = filePath;
 }
示例#2
0
 public static GurpsCharacter fromJson(object jsonObject, GurpsDatabase database)
 {
     GurpsCharacter character = new GurpsCharacter(database);
     var dict = (Dictionary<string, object>)jsonObject;
     character.name = (string)dict["name"];
     character.layout = AbstractTraitGroup.fromJson(dict["layout"]);
     foreach (object purchaseObject in (List<object>)dict["purchases"])
     {
         var purchase = (Dictionary<string, object>)purchaseObject;
         character.getPurchasedProperty((string)purchase["trait"]).PurchasedLevels = (int)purchase["purchased"];
     }
     return character;
 }