public string GetBagLayout()
{
if (this.Bag == null)
{
Log.Debug("PersonalShop.GetBagLayout: Bag not set.");
return null;
}
var linkedPocket = this.Bag.OptionInfo.LinkedPocketId;
var pocket = this.Owner.Inventory.GetPocket(linkedPocket);
if (pocket == null)
{
Log.Debug("PersonalShop.GetBagLayout: Pocket '{0}' not found.", linkedPocket);
return null;
}
var normalPocket = pocket as InventoryPocketNormal;
if (normalPocket == null)
{
Log.Debug("PersonalShop.GetBagLayout: Invalid pocket type '{0}'.", pocket.GetType().Name);
return null;
}
// TODO: Non-rectangular bag layouts.
return string.Format("{0}/{1}", normalPocket.Width, normalPocket.Height);
}