Esempio n. 1
0
        public void RevealItem()
        {
            if (this.item != null && this.SheetState != SpriteStates.Sheets.USED)
            {
                this.SetSpriteState(SpriteStates.Sprites.IDLE);

                if (!(this.item is SpriteCoin))
                {
                    SoundFactory.PlaySoundEffect(SoundFactory.PowerUpAppear());
                }

                Thread t = new Thread(new ThreadStart(
                                          delegate()
                {
                    this.item.Info.position = this.Info.position;
                    this.itemCount--;
                    (this.item as IRevealable).Reveal();
                    if (this.itemCount <= 0)
                    {
                        this.item = null;
                        this.SetSheetState(SpriteStates.Sheets.USED);
                    }

                    Console.WriteLine("Reveal finished");
                }
                                          ));
                t.IsBackground = true;
                t.Start();
            }
        }