Exemple #1
0
 public void DelAction(ChaActionType type)
 {
     if (mContainer != null)
     {
         mContainer.DelAction(type);
     }
 }
Exemple #2
0
    public static T CreateAction <T>(ChaActionType type) where T : IAction, new()
    {
        Queue <IAction> pool = null;

        if (!ActionPool.TryGetValue(type, out pool))
        {
            pool = new Queue <IAction>();
            ActionPool.Add(type, pool);
        }

        IAction action = null;

        if (pool.Count == 0)
        {
            action = new T();
            action.SetType(type);
        }
        else
        {
            action = pool.Dequeue();
        }
        if (action != null)
        {
            return(action as T);
        }

        return(null);
    }
Exemple #3
0
 public bool HasAction(ChaActionType type)
 {
     if (mContainer != null)
     {
         return(mContainer.HasAction(type));
     }
     return(false);
 }
Exemple #4
0
 public IAction GetAcion(ChaActionType type)
 {
     if (mContainer != null)
     {
         return(mContainer.GetAction(type));
     }
     return(null);
 }
Exemple #5
0
    public static void DeleteAction(IAction action)
    {
        ChaActionType   type = action.mType;
        Queue <IAction> pool = null;

        if (!ActionPool.TryGetValue(type, out pool))
        {
            return;
        }
        pool.Enqueue(action);
    }
Exemple #6
0
    public void DelAction(ChaActionType type)
    {
        IAction action = mActions[(int)type];

        if (action == null)
        {
            return;
        }
        action.Exit();
        mActions[(int)type] = null;
        IAction.DeleteAction(action);
    }
Exemple #7
0
 public virtual void SetType(ChaActionType etype)
 {
     mType = etype;
 }
Exemple #8
0
 public override void SetType(ChaActionType etype)
 {
     base.SetType(ChaActionType.SkillMove);
 }
 public bool HasAction(ChaActionType type)
 {
     return(mContainer.HasAction(type));
 }
 public IAction GetAcion(ChaActionType type)
 {
     return(mContainer.GetAction(type));
 }
 public void DelAction(ChaActionType type)
 {
     mContainer.DelAction(type);
 }
Exemple #12
0
    public bool HasAction(ChaActionType type)
    {
        IAction action = mActions[(int)type];

        return(action != null);
    }
Exemple #13
0
 public IAction GetAction(ChaActionType type)
 {
     return(mActions[(int)type]);
 }
Exemple #14
0
 public IAction(ChaActionType type)
 {
     mType = type;
 }