コード例 #1
0
ファイル: Playable.cs プロジェクト: chalkos/SabberStone
        public virtual void ApplyEnchantments(EnchantmentActivation activation, Zone zoneType, IPlayable target = null)
        {
            var removeEnchantments = new List <Enchantment>();

            Enchantments.ForEach(p =>
            {
                if (p.Activation == activation && (Zone == null || Zone.Type == zoneType))
                {
                    p.Activate(Controller, this, target);
                    if (p.RemoveAfterActivation)
                    {
                        removeEnchantments.Add(p);
                    }
                }
            });

            removeEnchantments.ForEach(p => Enchantments.Remove(p));
        }
コード例 #2
0
 public ActivateEnchantment(EntityType entityType, EnchantmentActivation activation)
 {
     Type       = entityType;
     Activation = activation;
 }