/// <summary>
/// Populates the container based on what is linked to the objInt
/// </summary>
/// <param name="cn">Cn.</param>
/// <param name="objInt">Object int.</param>
public static void PopulateContainer(Container cn, ObjectInteraction objInt, ObjectLoader objList)
{
//cn.ObjectsAccepted=-1;//For now default to accept all
cn.Capacity = 40;
for (int i = 0; i <= cn.MaxCapacity(); i++)
{ //init the variables.
if (cn.items[i] == null)
{
cn.items[i] = "";
}
}
if (objInt.link != 0) //Container has objects
{
ObjectLoaderInfo tmpobj = ObjectLoader.getObjectInfoAt(objInt.link, objList);
//int count = 0;
if (ObjectLoader.GetItemTypeAt(objInt.link, objList) != ObjectInteraction.LOCK)
{
cn.AddItemToContainer(ObjectLoader.UniqueObjectName(tmpobj));
}
while (tmpobj.next != 0)
{
tmpobj = ObjectLoader.getObjectInfoAt((int)tmpobj.next, objList); //objList[tmpobj.next];
cn.AddItemToContainer(ObjectLoader.UniqueObjectName(tmpobj));
}
}
}