OSDMap map = new OSDMap(2);
OSDMap agentMap = new OSDMap(1);
agentMap.put("Flags", OSD.FromInteger(Flags));
map.put("AgentData", agentMap);
OSDArray layerArray = new OSDArray(LayerDataBlocks.length);
for (int i = 0; i < LayerDataBlocks.length; i++)
{
OSDMap layerMap = new OSDMap(5);
layerMap.put("ImageID", OSD.FromUUID(LayerDataBlocks[i].ImageID));
layerMap.put("Bottom", OSD.FromInteger(LayerDataBlocks[i].Bottom));
layerMap.put("Left", OSD.FromInteger(LayerDataBlocks[i].Left));
layerMap.put("Top", OSD.FromInteger(LayerDataBlocks[i].Top));
layerMap.put("Right", OSD.FromInteger(LayerDataBlocks[i].Right));
layerArray.add(layerMap);
}
map.put("LayerData", layerArray);
return map;