Exemplo n.º 1
0
        public void PlaySound(UUID audio, Vector3 position)
        {
            ISoundModule soundModule = m_internalScene.RequestModuleInterface <ISoundModule>();

            if (soundModule != null)
            {
                soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position,
                                         m_internalScene.RegionInfo.RegionHandle, 0);
            }
        }
Exemplo n.º 2
0
        public void Play(UUID asset, double volume)
        {
            if (!CanEdit())
            {
                return;
            }
            ISoundModule module = m_rootScene.RequestModuleInterface <ISoundModule>();

            if (module != null)
            {
                module.SendSound(GetSOP().UUID, asset, volume, true, 0, 0, false, false);
            }
        }
        public void GivenShoppingBasket_WhenPriceUpdatedHigher_ThenDisplayShowsExpectedResult()
        {
            //Arrange
            ISoundModule  fakeSoundModule  = A.Fake <ISoundModule>();
            IPriceCatalog fakePriceCatalog = A.Fake <IPriceCatalog>();
            var           catalog          = new Article[]
            {
                new Article()
                {
                    Id    = 1,
                    Name  = "12 Eggs",
                    Price = 3.20m
                },
                new Article()
                {
                    Id    = 2,
                    Name  = "1l Water",
                    Price = 1.50m
                }
            };

            A.CallTo(() => fakePriceCatalog.GetArticle(A <int> ._))
            .ReturnsLazily((int id) => catalog.Single(a => a.Id == id));

            string expected = "2 x 12 Eggs, 5.38 Euro; 5 x 1l Water, 7.50 Euro; Total Amount: 12.88 Euro";
            var    sut      = new ShoppingBasket(fakeSoundModule, fakePriceCatalog, 0, new ArticleEntry[]
            {
                new ArticleEntry()
                {
                    ArticleId = 1,
                    Count     = 2,
                    Name      = "12 Eggs",
                    UnitPrice = 2.69m
                },
                new ArticleEntry()
                {
                    ArticleId = 1,
                    Count     = 5,
                    Name      = "1l Water",
                    UnitPrice = 1.5m
                }
            });

            //Act
            sut.UpdatePrices();

            //Assert
            sut.Display.Should().Be(expected);
            A.CallTo(() => fakeSoundModule.Beep()).MustNotHaveHappened();
        }
        public void GivenShoppingBasket_WhenWeightExceeded_ThenDisplayShowsExpectedResult()
        {
            //Arrange
            ISoundModule  fakeSoundModule  = A.Fake <ISoundModule>();
            IPriceCatalog fakePriceCatalog = A.Fake <IPriceCatalog>();

            A.CallTo(() => fakePriceCatalog.GetArticle(A <int> ._)).Returns(new Article());
            var    sut      = new ShoppingBasket(fakeSoundModule, fakePriceCatalog, 0.75f);
            string expected = "Allowed weight exceeded, please remove one or more articles.";

            //Act
            sut.AddArticle(0, 1);

            //Assert
            sut.Display.Should().Be(expected);
            A.CallTo(() => fakeSoundModule.Beep()).MustHaveHappened(3, Times.Exactly);
        }
        public void GivenEmptyBasket_WhenItemIsAdded_ThenDisplayShowsExpectedResult()
        {
            //Arrange
            ISoundModule  fakeSoundModule  = A.Fake <ISoundModule>();
            IPriceCatalog fakePriceCatalog = A.Fake <IPriceCatalog>();

            A.CallTo(() => fakePriceCatalog.GetArticle(1)).Returns(new Article()
            {
                Id    = 1,
                Name  = "12 Eggs",
                Price = 2.69m
            });

            string expected = "1 x 12 Eggs, 2.69 Euro; Total Amount: 2.69 Euro";
            var    sut      = new ShoppingBasket(fakeSoundModule, fakePriceCatalog, 0);

            //Act
            sut.AddArticle(1, 0);

            //Assert
            sut.Display.Should().Be(expected);
        }
Exemplo n.º 6
0
        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
        {
            m_ScriptEngine = scriptEngine;
            m_host = host;
            m_item = item;
            m_coopSleepHandle = coopSleepHandle;

            LoadConfig();

            m_TransferModule =
                    m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
            m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
            m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>();

            AsyncCommands = new AsyncCommandManager(m_ScriptEngine);
        }
Exemplo n.º 7
0
 public void RemoveSource(ISoundModule source)
 {
     inputs.Remove(source);
 }
Exemplo n.º 8
0
 public void AddSource(ISoundModule source)
 {
     inputs.Add(source);
 }
Exemplo n.º 9
0
 public ShoppingBasket(ISoundModule soundModule, IPriceCatalog priceCatalog, float allowedWeight, ArticleEntry[] articles)
     : this(soundModule, priceCatalog, allowedWeight)
 {
     _innerArticles = articles.ToList();
 }
Exemplo n.º 10
0
 public ShoppingBasket(ISoundModule soundModule, IPriceCatalog priceCatalog, float allowedWeight)
 {
     _soundModule   = soundModule;
     _priceCatalog  = priceCatalog;
     _allowedWeight = allowedWeight;
 }
Exemplo n.º 11
0
 public void SetController(ISoundModule controller)
 {
     this.Module = controller;
 }
Exemplo n.º 12
0
        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item)
        {
            m_lastSayShoutCheck = DateTime.UtcNow;

            m_ScriptEngine = scriptEngine;
            m_host = host;
            m_item = item;
            m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
 
            LoadConfig();

            m_TransferModule =
                    m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
            m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
            m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>();

            AsyncCommands = new AsyncCommandManager(m_ScriptEngine);
        }
Exemplo n.º 13
0
        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_item = item;

            LoadLimits();  // read script limits from config.

            m_TransferModule =
                    m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
            m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
            m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>();

            AsyncCommands = new AsyncCommandManager(ScriptEngine);
        }