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; }
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; }