Пример #1
0
    public void Deliver(Vector2 deliverPosition, ICollectable collectable)
    {
        if (collectable.GetType() == typeof(Resource))
        {
            DeliverResource(deliverPosition, collectable as Resource);
        }

        else if (collectable.GetType() == typeof(ResourceCrate))
        {
            DeliverCrate(collectable as ResourceCrate);
        }
    }
Пример #2
0
        public void Add(ICollectable gem)
        {
            if (gem.GetType() == typeof(NullGem))
            {
                return;
            }

            if (bag.Count < capacity)
            {
                log.Information("{actor} add {gem} in bag({bagItems})", "Digger", gem.GetType().Name, bag.Count);
                bag.Add(gem);
            }
        }
Пример #3
0
 public void TenoItemCollide(Teno teno, ICollectable item)
 {
     if (item.GetType().Equals(new Coin(item.position).GetType()))
     {
         //SoundManager.coinCollect.Play();
         //game.gameHUD.Coins++;
         //game.gameHUD.Score += ValueHolder.coinCollectPoints;
     }
 }
Пример #4
0
 public void MarioItemCollide(ICollectable item, Mario mario)
 {
     if (item.GetType().Equals(new Star(item.position).GetType()))
     {
         mario.isStar        = true;
         game.gameHUD.Score += ValueHolder.itemCollectPoints;
         if (!mario.isNinja)
         {
             SoundManager.PlaySong(SoundManager.songs.star);
         }
     }
     if (item.GetType().Equals(new Ninja(item.position).GetType()))
     {
         mario.MakeNinjaMario();
         mario.isNinja       = true;
         game.gameHUD.Score += ValueHolder.itemCollectPoints;
         SoundManager.PlaySong(SoundManager.songs.ninja);
     }
     if (item.GetType().Equals(new SuperMushroom(item.position).GetType()))
     {
         mario.MakeBigMario();
         game.gameHUD.Score += ValueHolder.itemCollectPoints;
         SoundManager.grow.Play();
         game.ach.AchievementAdjustment(AchievementsManager.AchievementType.Mushroom);
     }
     if (item.GetType().Equals(new FireFlower(item.position).GetType()))
     {
         mario.MakeFireMario();
         game.gameHUD.Score += ValueHolder.itemCollectPoints;
         SoundManager.grow.Play();
     }
     if (item.GetType().Equals(new Coin(item.position).GetType()))
     {
         SoundManager.coinCollect.Play();
         game.gameHUD.Coins++;
         game.gameHUD.Score += ValueHolder.coinCollectPoints;
     }
     if (item.GetType().Equals(new OneUpMushroom(item.position).GetType()))
     {
         SoundManager.oneUp.Play();
         game.gameHUD.Lives++;
         game.ach.AchievementAdjustment(AchievementsManager.AchievementType.Life);
     }
 }