} // @ private PLAYERINFO GetPlayerInfo() /// <summary> /// Will get all craft details as a List<> /// </summary> /// <returns>List<> of CraftDetails populated with all crafting information.</returns> public List <CraftDetails> GetAllCraftDetails() { List <CraftDetails> ret = new List <CraftDetails>(); ushort value; foreach (byte val in Enum.GetValues(typeof(Craft))) { PlayerCraftLevels craftLevels = GetPlayerInformation().CraftLevels; switch ((Craft)val) { case Craft.Alchemy: value = craftLevels.Alchemy; break; case Craft.Bonecrafting: value = craftLevels.Bonecraft; break; case Craft.Clothcraft: value = craftLevels.Clothcraft; break; case Craft.Cooking: value = craftLevels.Cooking; break; case Craft.Fishing: value = craftLevels.Fishing; break; case Craft.Goldsmithing: value = craftLevels.Goldsmithing; break; case Craft.Leathercraft: value = craftLevels.Leathercraft; break; case Craft.Smithing: value = craftLevels.Smithing; break; case Craft.Woodworking: value = craftLevels.Woodworking; break; case Craft.Synergy: value = craftLevels.Synergy; break; default: continue; } CraftDetails details = new CraftDetails((Craft)val, ((value & 0x1FE0) >> 5), (CraftRank)(value & 0x1F), Convert.ToBoolean(((value & 0x8000) >> 15))); //CraftDetails tmp = GetCraftDetails((Craft)val); ret.Add(details); } return(ret); }
/// <summary> /// Will get craft details about the passed craft /// </summary> /// <param name="craft">Craft to get details about</param> public CraftDetails GetCraftDetails(Craft craft) { // Get craft information from fface PlayerCraftLevels craftLevels = GetPlayerInformation().CraftLevels; // value of specific craft int value = 0; // See which craft is selected switch (craft) { case Craft.Alchemy: value = craftLevels.Alchemy; break; case Craft.Bonecrafting: value = craftLevels.Bonecraft; break; case Craft.Clothcraft: value = craftLevels.Clothcraft; break; case Craft.Cooking: value = craftLevels.Cooking; break; case Craft.Fishing: value = craftLevels.Fishing; break; case Craft.Goldsmithing: value = craftLevels.Goldsmithing; break; case Craft.Leathercraft: value = craftLevels.Leathercraft; break; case Craft.Smithing: value = craftLevels.Smithing; break; case Craft.Woodworking: value = craftLevels.Woodworking; break; case Craft.Synergy: value = craftLevels.Synergy; break; default: throw new ArgumentException("Unknown craft passed to GetCraftDetails()"); } // @ switch (craft) // create return result CraftDetails details = new CraftDetails(craft, ((value & 0x1FE0) >> 5), (CraftRank)(value & 0x1F), Convert.ToBoolean(((value & 0x8000) >> 15))); //details.Capped = Convert.ToBoolean(((value & 0x8000) >> 15)); //details.Level = ((value & 0x1FE0) >> 5); //details.Rank = (CraftRank)(value & 0x1F); //details.Skill = craft; return(details); } // @ public CraftDetails GetCraftDetails(Craft craft)