﻿using UnityEngine;
using System.Collections;
using Fineness.Framework.Interfaces;

public class RotationEffectCommand : EffectCommand {
    
    public RotationEffectCommand(IController controller) : base(controller)
    {

    }

    protected override void AddItem(IEffectItem target)
    {
        base.AddItem(target);

        RotationEffectItem item = (RotationEffectItem)target;
        item.OwnedEffectList = mEffects;
    }

    protected override void ApplyEffectItems(int dTime)
    {
        base.ApplyEffectItems(dTime);

        int i = 0;
        int max = mEffects.Count;
        RotationEffectItem item;
        for (i = 0; i < max; i++)
        {
            item = (RotationEffectItem)mEffects[i];
            item.Apply(dTime);
        }
    }

    public override string Name
    {
        get
        {
            return FConsts.ROTATION_EFFECT_COMMAND;
        }
    }

}
