29 using System.Collections.Generic;
32 namespace OpenSim.Framework
38 private bool m_parseError =
false;
44 public const uint allowedNextPermitions = 0;
51 it.BasePermissions = createBasePermitions;
52 it.CurrentPermissions = createBasePermitions;
54 it.NextPermissions = createNextPermitions;
56 it.GroupPermissions = 0;
57 it.EveryOnePermissions = 0;
70 bp = createBasePermitions;
71 np = createNextPermitions;
75 bp = allowedBasePermitions;
76 np = allowedNextPermitions;
79 it.BasePermissions &= bp;
80 it.CurrentPermissions &= bp;
82 it.NextPermissions &= np;
84 it.GroupPermissions = 0;
85 it.EveryOnePermissions = 0;
88 public int AnimationCount {
get;
private set; }
89 private Dictionary<string, KeyValuePair<string, UUID>> m_animations =
new Dictionary<string, KeyValuePair<string, UUID>>();
93 KeyValuePair<string, UUID> val;
94 if (m_animations.TryGetValue(index, out val))
102 KeyValuePair<string, UUID> val;
103 if (m_animations.TryGetValue(index, out val))
111 if (anim == UUID.Zero)
113 m_animations.Remove(index);
117 m_animations[index] =
new KeyValuePair<string, UUID>(name, anim);
122 string assetData = System.Text.Encoding.ASCII.GetString(data);
123 Console.WriteLine(
"--------------------");
124 Console.WriteLine(
"AnimationSet length {0} bytes", assetData.Length);
125 Console.WriteLine(assetData);
126 Console.WriteLine(
"--------------------");
135 string dummy =
"version 1\ncount 0\n";
136 return System.Text.Encoding.ASCII.GetBytes(dummy);
139 string assetData = String.Format(
"version 1\ncount {0}\n", m_animations.Count);
140 foreach (KeyValuePair<
string, KeyValuePair<string, UUID>> kvp
in m_animations)
141 assetData += String.Format(
"{0} {1} {2}\n", kvp.Key, kvp.Value.Value.ToString(), kvp.Value.Key);
142 return System.Text.Encoding.ASCII.GetBytes(assetData);
150 List<string> badAnims =
new List<string>();
153 foreach (KeyValuePair<
string, KeyValuePair<string, UUID>> kvp
in m_animations)
155 if (!val(kvp.Value.Value))
158 badAnims.Add(kvp.Key);
162 foreach (
string idx
in badAnims)
163 m_animations.Remove(idx);
UUID GetAnimation(string index)
static void setCreateItemPermitions(InventoryItemBase it)
delegate bool AnimationSetValidator(UUID animID)
static void enforceItemPermitions(InventoryItemBase it, bool IsCreator)
void SetAnimation(string index, string name, UUID anim)
string GetAnimationName(string index)
Inventory Item - contains all the properties associated with an individual inventory piece...
bool Validate(AnimationSetValidator val)
AnimationSet(Byte[] data)