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

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