Esempio n. 1
0
 public void DelAction(ChaActionType type)
 {
     if (mContainer != null)
     {
         mContainer.DelAction(type);
     }
 }
Esempio n. 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);
    }
Esempio n. 3
0
 public bool HasAction(ChaActionType type)
 {
     if (mContainer != null)
     {
         return(mContainer.HasAction(type));
     }
     return(false);
 }
Esempio n. 4
0
 public IAction GetAcion(ChaActionType type)
 {
     if (mContainer != null)
     {
         return(mContainer.GetAction(type));
     }
     return(null);
 }
Esempio n. 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);
    }
Esempio n. 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);
    }
Esempio n. 7
0
 public virtual void SetType(ChaActionType etype)
 {
     mType = etype;
 }
Esempio n. 8
0
 public override void SetType(ChaActionType etype)
 {
     base.SetType(ChaActionType.SkillMove);
 }
Esempio n. 9
0
 public bool HasAction(ChaActionType type)
 {
     return(mContainer.HasAction(type));
 }
Esempio n. 10
0
 public IAction GetAcion(ChaActionType type)
 {
     return(mContainer.GetAction(type));
 }
Esempio n. 11
0
 public void DelAction(ChaActionType type)
 {
     mContainer.DelAction(type);
 }
Esempio n. 12
0
    public bool HasAction(ChaActionType type)
    {
        IAction action = mActions[(int)type];

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