public void OnPlayerMove(IPlayer player) { var dynamicItem = this.Sprite as DynamicItem; if (dynamicItem == null) { return; } switch (dynamicItem.Category) { case EntityCategoryType.Knowledge: player.Knowledge += dynamicItem.ItemRate; Sounds.KnowledgeUp(); break; case EntityCategoryType.Defense: player.Defense += dynamicItem.ItemRate; Sounds.DefenseUp(); break; case EntityCategoryType.Health: player.Health += dynamicItem.ItemRate; Sounds.HealthUp(); break; case EntityCategoryType.Mana: player.Mana += dynamicItem.ItemRate; Sounds.ManaUp(); break; case EntityCategoryType.Certificate: player.HasCertificate = true; break; case EntityCategoryType.Key: player.HasKey = true; Sounds.Pickup(); break; } this.foregroundSprite = null; }