123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System;
- using OpenMetaverse;
- using OpenMetaverse.StructuredData;
- namespace OpenSim.Framework
- {
- public class AvatarAttachment
- {
- public int AttachPoint;
- public UUID ItemID;
- public UUID AssetID;
- public AvatarAttachment(AvatarAttachment attach)
- {
- AttachPoint = attach.AttachPoint;
- ItemID = attach.ItemID;
- AssetID = attach.AssetID;
- }
- public AvatarAttachment(int point, UUID item, UUID asset)
- {
- AttachPoint = point;
- ItemID = item;
- AssetID = asset;
- }
- public AvatarAttachment(OSDMap args)
- {
- Unpack(args);
- }
- public OSDMap Pack()
- {
- OSDMap attachdata = new OSDMap();
- attachdata["point"] = OSD.FromInteger(AttachPoint);
- attachdata["item"] = OSD.FromUUID(ItemID);
- attachdata["asset"] = OSD.FromUUID(AssetID);
- return attachdata;
- }
- public void Unpack(OSDMap args)
- {
- if (args["point"] != null)
- AttachPoint = args["point"].AsInteger();
- ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero;
- AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero;
- }
- }
- }
|