Add my work on top of cmickeyb's

avinationmerge
Melanie 2010-10-29 20:48:37 +02:00
parent 9331898c32
commit 840b75ca9b
3 changed files with 133 additions and 1 deletions

View File

@ -35,6 +35,104 @@ using log4net;
namespace OpenSim.Framework
{
// A special dictionary for avatar appearance
public struct LayerItem
{
public UUID ItemID;
public UUID AssetID;
public LayerItem(UUID itemID, UUID assetID)
{
ItemID = itemID;
AssetID = assetID;
}
}
public class Layer
{
protected int m_layerType;
protected Dictionary<UUID, UUID> m_items = new Dictionary<UUID, UUID>();
protected List<UUID> m_ids = new List<UUID>();
public Layer(int type)
{
m_layerType = type;
}
public int LayerType
{
get { return m_layerType; }
}
public int Count
{
get { return m_ids.Count; }
}
public void Add(UUID itemID, UUID assetID)
{
if (m_items.ContainsKey(itemID))
return;
if (m_ids.Count >= 5)
return;
m_ids.Add(itemID);
m_items[itemID] = assetID;
}
public void Wear(UUID itemID, UUID assetID)
{
Clear();
Add(itemID, assetID);
}
public void Clear()
{
m_ids.Clear();
m_items.Clear();
}
public void RemoveItem(UUID itemID)
{
if (m_items.ContainsKey(itemID))
{
m_ids.Remove(itemID);
m_items.Remove(itemID);
}
}
public void RemoveAsset(UUID assetID)
{
UUID itemID = UUID.Zero;
foreach (KeyValuePair<UUID, UUID> kvp in m_items)
{
if (kvp.Value == assetID)
{
itemID = kvp.Key;
break;
}
}
if (itemID != UUID.Zero)
{
m_ids.Remove(itemID);
m_items.Remove(itemID);
}
}
public LayerItem this [int idx]
{
get
{
if (idx >= m_ids.Count || idx < 0)
return new LayerItem(UUID.Zero, UUID.Zero);
return new LayerItem(m_ids[idx], m_items[m_ids[idx]]);
}
}
}
/// <summary>
/// Contains the Avatar's Appearance and methods to manipulate the appearance.
/// </summary>

View File

@ -1,4 +1,10 @@
<Nini>
<Section Name="Default Alpha">
<Key Name="assetID" Value="1578a2b1-5179-4b53-b618-fe00ca5a5594" />
<Key Name="name" Value="alpha" />
<Key Name="assetType" Value="0" />
<Key Name="fileName" Value="defaultalpha.jp2" />
</Section>
<Section Name="texture1">
<Key Name="assetID" Value="00000000-0000-2222-3333-000000000099" />
<Key Name="name" Value="femface" />

View File

@ -16,6 +16,34 @@
</Section>
-->
<!--
<Section Name="Tattoo">
<Key Name="inventoryID" Value="c47e22bd-3021-4ba4-82aa-2b5cb34d35e1" />
<Key Name="assetID" Value="00000000-0000-2222-3333-100000001007" />
<Key Name="folderID" Value="d499e5e0-b9bf-11dc-95ff-0800200c9a66"/>
<Key Name="description" Value="Tattoo" />
<Key Name="name" Value="Tattoo" />
<Key Name="assetType" Value="13" />
<Key Name="inventoryType" Value="18" />
<Key Name="currentPermissions" Value="2147483647" />
<Key Name="nextPermissions" Value="2147483647" />
<Key Name="everyonePermissions" Value="2147483647" />
<Key Name="basePermissions" Value="2147483647" />
</Section>
<Section Name="Alpha">
<Key Name="inventoryID" Value="bfb9923c-4838-4d2d-bf07-608c5b1165c8" />
<Key Name="assetID" Value="1578a2b1-5179-4b53-b618-fe00ca5a5594" />
<Key Name="folderID" Value="d499e5e0-b9bf-11dc-95ff-0800200c9a66"/>
<Key Name="description" Value="Hair" />
<Key Name="name" Value="Hair" />
<Key Name="assetType" Value="13" />
<Key Name="inventoryType" Value="18" />
<Key Name="currentPermissions" Value="2147483647" />
<Key Name="nextPermissions" Value="2147483647" />
<Key Name="everyonePermissions" Value="2147483647" />
<Key Name="basePermissions" Value="2147483647" />
</Section>
<Section Name="Hair">
<Key Name="inventoryID" Value="d342e6c1-b9d2-11dc-95ff-0800200c9a66" />
<Key Name="assetID" Value="d342e6c0-b9d2-11dc-95ff-0800200c9a66" />