View of /trunk/ModularRex/RexParts/RexObjects/RexMaterialsDictionary.cs
Parent Directory
|
Revision Log
Revision 12 -
(download)
(annotate)
Thu Nov 27 12:11:01 2008 UTC (4 years, 5 months ago) by mikkopa
File size: 2225 byte(s)
Thu Nov 27 12:11:01 2008 UTC (4 years, 5 months ago) by mikkopa
File size: 2225 byte(s)
Initial RexPython work. Changed code so it compiles, but many functions still not implemented. Needs still lots of work.
using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using OpenSim.Region.Environment.Scenes;
using OpenMetaverse;
namespace ModularRex.RexParts.RexObjects
{
public class RexMaterialsDictionary : Dictionary<uint, UUID>, ICloneable, IXmlSerializable
{
private RexObjectPart MyPart = null;
public void SetSceneObjectPart(RexObjectPart vPart)
{
MyPart = vPart;
}
public void AddMaterial(uint vIndex, UUID vMaterialUUID)
{
lock (this)
{
this[vIndex] = vMaterialUUID;
}
if (MyPart != null)
MyPart.ScheduleRexPrimUpdate(true);
}
public void DeleteMaterialByIndex(uint vIndex)
{
lock (this)
{
if (this.ContainsKey(vIndex))
{
this.Remove(vIndex);
if (MyPart != null)
MyPart.ScheduleRexPrimUpdate(true);
}
}
}
public void ClearMaterials()
{
lock (this)
{
this.Clear();
}
if (MyPart != null)
MyPart.ScheduleRexPrimUpdate(true);
}
public void ReadXml(XmlReader reader)
{
}
public void WriteXml(XmlWriter writer)
{
}
public XmlSchema GetSchema()
{
return null;
}
public Object Clone()
{
RexMaterialsDictionary clone = new RexMaterialsDictionary();
lock (this)
{
foreach (uint matindex in Keys)
clone.Add(matindex, this[matindex]);
}
return clone;
}
public override string ToString()
{
string s = String.Empty;
foreach (uint matindex in Keys)
s = s + "idx:" + matindex.ToString() + ",value:" + this[matindex].ToString() + "\n";
return s;
}
}
}
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

