1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using OpenMetaverse;
- using OpenSim.Framework;
- namespace OpenSim.Tests.Common.Mock
- {
- public class BaseAssetRepository
- {
- protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>();
- public AssetBase FetchAsset(UUID uuid)
- {
- if (AssetsExist(new[] { uuid })[0])
- return Assets[uuid];
- else
- return null;
- }
- public void CreateAsset(AssetBase asset)
- {
- Assets[asset.FullID] = asset;
- }
- public void UpdateAsset(AssetBase asset)
- {
- CreateAsset(asset);
- }
- public bool[] AssetsExist(UUID[] uuids)
- {
- return Array.ConvertAll(uuids, id => Assets.ContainsKey(id));
- }
- }
- }
|