public OSRICAttributeModel(RPGCharacterModel _cm, JSONObject _jo) { cm = _cm; CharacterModifiers = new OSRICModifierCollection(); characterName = _jo["characterName"].str; Str = (int)_jo["Str"].n; Dex = (int)_jo["Dex"].n; Con = (int)_jo["Con"].n; Int = (int)_jo["Int"].n; Wis = (int)_jo["Wis"].n; Cha = (int)_jo["Cha"].n; hitPoints = (int)_jo["hitPoints"].n; string[] levelStr = _jo["level"].str.Split('/'); level = new int[levelStr.Length]; for(int i=0; i<levelStr.Length; i++) level[i] = Int32.Parse(levelStr[i]); experiencePoints = (int)_jo["experiencePoints"].n; vision = (int)_jo["vision"].n; move = (int)_jo["move"].n; characterGender = OSRICConstants.GetEnum<OSRIC_GENDER>(_jo["characterGender"].str); characterRace = OSRICConstants.GetEnum<OSRIC_RACE>(_jo["characterRace"].str); characterClass = OSRICConstants.GetEnum<OSRIC_CLASS>(_jo["characterClass"].str); characterAlignment = OSRICConstants.GetEnum<OSRIC_ALIGNMENT>(_jo["characterAlignment"].str); characterState = OSRICConstants.GetEnum<OSRIC_CHARACTER_STATE>(_jo["characterState"].str); foreach(JSONObject obj in _jo["CharacterModifiers"].list) CharacterModifiers.Add(new OSRICCharacterModifier(obj)); }
public OSRICItemModel(JSONObject _jo) { UID = _jo["Uid"].str; ItemType = OSRICConstants.GetEnum<OSRIC_ITEM_TYPE>(_jo["ItemType"].str); Name = _jo["Name"].str; Description = _jo["Description"].str; string[] smd = _jo[""].str.Split('-'); if(smd.Length==2) { SmallMediumDamage = new Range(); SmallMediumDamage.min = Int32.Parse(smd[0]); SmallMediumDamage.max = Int32.Parse(smd[1]); } string[] ld = _jo["LargeDamage"].str.Split('-'); if(ld.Length==2) { LargeDamage = new Range(); LargeDamage.min = Int32.Parse(ld[0]); LargeDamage.max = Int32.Parse(ld[1]); } Encumberance = (int)_jo["Encumberance"].n; Cost = (int)_jo["Cost"].n; WeaponRange = (int)_jo["WeaponRange"].n; Charges = (int)_jo["Charges"].n; ModifierList = new OSRICModifierCollection(_jo["ModifierList"]); }
public OSRICAttributeModel(RPGCharacterModel _cm) { cm = _cm; CharacterModifiers = new OSRICModifierCollection(); }
private void initializeModifierList() { ModifierList = new OSRICModifierCollection(); }