BaseAssetRepository.cs 807 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.Generic;
  2. using OpenMetaverse;
  3. using OpenSim.Framework;
  4. namespace OpenSim.Tests.Common.Mock
  5. {
  6. public class BaseAssetRepository
  7. {
  8. protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>();
  9. public AssetBase FetchAsset(UUID uuid)
  10. {
  11. if (ExistsAsset(uuid))
  12. return Assets[uuid];
  13. else
  14. return null;
  15. }
  16. public void CreateAsset(AssetBase asset)
  17. {
  18. Assets[asset.FullID] = asset;
  19. }
  20. public void UpdateAsset(AssetBase asset)
  21. {
  22. CreateAsset(asset);
  23. }
  24. public bool ExistsAsset(UUID uuid)
  25. {
  26. return Assets.ContainsKey(uuid);
  27. }
  28. }
  29. }