public Character(string n, int s, int idd, int[] attrs, int[][] tals, int mh, int h, int me, int e, int mhu, int hu, int msa, int sa, int sta) { Item weapone = ReadLoadItem.ReadItemById(1); name = n; side = s; id = idd; maxHealth = mh; health = h; maxEnergy = me; energy = e; maxSatiety = mhu; satiety = hu; maxSanity = msa; sanity = sa; status = sta; if (maxId < idd) { maxId = idd; } for (int i = 0; i < 9; i++) { attributes.Add(new Attribute(attrs[i], tals[i])); } }
public Item(int numb) { Item buffer = ReadLoadItem.ReadItemById(numb); name = buffer.GetName(); description = buffer.GetDescription(); id = numb; mass = buffer.GetMass(); volume = buffer.GetVolume(); passiveUses = buffer.passiveUses; uses = buffer.GetAllUseItems(); }
public static Hike LoadHike(int id) { Hike hike = null; XmlDocument xACPDoc = new XmlDocument(); xACPDoc.Load(AllHikesPathsPath); if (Functions.CheckHikeExistion(Convert.ToString(id))) { XmlDocument hikeDocument = new XmlDocument(); string characterDocumentPath = prefix + namePrefix + id + extention; hikeDocument.Load(characterDocumentPath); XmlNode hikeRoot = hikeDocument.DocumentElement; string name = hikeRoot.ChildNodes[0].InnerText; int progress = Convert.ToInt32(hikeRoot.ChildNodes[1].InnerText); List <Character> characters = new List <Character> { }; foreach (XmlNode characterNode in hikeRoot.ChildNodes[2]) { characters.Add(ReadLoadCharacter.ReadCharacterBySideAndId(characterNode.InnerText)); } List <Coords> coords = new List <Coords> { }; Coords coord; foreach (XmlNode coordNode in hikeRoot.ChildNodes[3]) { coord = new Coords(Convert.ToInt32(coordNode.ChildNodes[0].InnerText), Convert.ToInt32(coordNode.ChildNodes[1].InnerText)); coords.Add(coord); } Eventt quest = ReadLoadTile.GetEventt(hikeRoot.ChildNodes[4]);//!!!!!!!!! ReadLoadTile.tCheck(); XmlNode StorageNode = hikeRoot.ChildNodes[5]; int maxVolume = Convert.ToInt32(StorageNode.ChildNodes[0].InnerText); int maxMass = Convert.ToInt32(StorageNode.ChildNodes[1].InnerText); List <Item> items = new List <Item> { }; foreach (XmlNode itemNode in StorageNode.ChildNodes[2]) { items.Add(ReadLoadItem.ReadItemById(Convert.ToInt32(itemNode.InnerText))); } Storage storage = new Storage(items, maxVolume, maxMass); hike = new Hike(name, progress, characters, coords, quest, storage); } return(hike); }
public Character(string n, int s, int[] attrs, int[][] tals, int h, int e, int hu, int sa) { Item weapone = ReadLoadItem.ReadItemById(1); name = n; side = s; id = maxId; maxHealth = h; health = maxHealth; maxEnergy = e; energy = maxEnergy; maxSatiety = hu; satiety = maxSatiety; maxSanity = sa; sanity = maxSanity; maxId++; for (int i = 0; i < 9; i++) { attributes.Add(new Attribute(attrs[i], tals[i])); } }