Beispiel #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            // TODO: Implement Functionality Here
            IBookManager bm = BookManagerFactory.GetBookManager();

            User moi = bm.GetAllUsers().SingleOrDefault(x => x.Identifier == 1);

            List <Book> allBooks = bm.GetAllBooks();
            //var allUserBooks = bm.GetAllUserBooks();

            IBookSelecter selecter  = new ContinueSerie();
            IBookSelecter selecter2 = new NewAuthor();
            IBookSelecter selecter3 = new TerminerSerie();
            IBookSelecter selecter4 = new VieuxTruc();
            IBookSelecter selecter5 = new ViteLu();
            IBookSelecter selecter6 = new RecentlyAdded();
            IBookSelecter selecter7 = new OneShot();
            IBookSelecter selecter8 = new StartNewSerie();


            BookSelecterCriteria criteria = new BookSelecterCriteria()
            {
                AuthorLike = "nath"
            };

            TrySelecter(selecter7, allBooks, criteria, moi);
            // TrySelecter(selecter2, allBooks, criteria, moi);


            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
Beispiel #2
0
 public void PlayOneShot(AudioClip clip)
 {
     if (isAI)
     {
         OneShot.CreateOneShot(clip, transform, AudioSettings.VOLUME_MAIN, 1.0f, aiSoundMinDistance, aiSoundMaxDistance);
     }
     else
     {
         OneShot.CreateOneShot(clip, AudioSettings.VOLUME_MAIN, 1.0f);
     }
 }
    public void Stop(string in_name)
    {
        Music m = Array.Find(music, sounds => sounds.name == in_name);

        if (m != null)
        {
            m.Stop();

            currentlyPlaying.Remove(in_name);
            return;
        }
        OneShot o = Array.Find(oneShots, sounds => sounds.name == in_name);

        if (o != null)
        {
            o.Stop();

            currentlyPlaying.Remove(in_name);
            return;
        }
    }
    public void FadeIn(string in_name)
    {
        Music m = Array.Find(music, sounds => sounds.name == in_name);

        if (m != null)
        {
            StartChildCoroutine(m.FadeIn());

            currentlyPlaying.Add(in_name);
            return;
        }
        OneShot o = Array.Find(oneShots, sounds => sounds.name == in_name);

        if (o != null)
        {
            StartChildCoroutine(o.FadeIn());

            currentlyPlaying.Add(in_name);
            return;
        }
    }
    public void StopAll()
    {
        foreach (string s in currentlyPlaying)
        {
            Music m = Array.Find(music, sounds => sounds.name == s);
            if (m != null)
            {
                m.Stop();
                return;
            }
            OneShot o = Array.Find(oneShots, sounds => sounds.name == s);
            if (o != null)
            {
                o.Stop();

                return;
            }
        }

        currentlyPlaying.Clear();
    }
    // Update is called once per frame

    public void Play(string in_name)
    {
        Music m = Array.Find(music, sounds => sounds.name == in_name);

        if (m != null)
        {
            StartChildCoroutine(m.Play());
            currentlyPlaying.Add(in_name);
            return;
        }
        OneShot o = Array.Find(oneShots, sounds => sounds.name == in_name);

        if (o != null)
        {
            o.Play();

            currentlyPlaying.Add(in_name);
            return;
        }
        Debug.LogWarning("No valid Audio matches name: " + in_name);
        return;
    }
Beispiel #7
0
 public Foo(OneShot <int> setOnce)
 {
     this.setOnce = setOnce;
 }
Beispiel #8
0
 private void Start()
 {
     playerRect = this.GetComponent <RectTransform>();
     oneShot    = new OneShot();
 }