예제 #1
0
파일: AI.cs 프로젝트: jhurliman/d3research
        public void BeginInteract(World world, PowerName power, Actor target,
                                  InteractSuccessCallback success, AIEventCallback callback)
        {
            Interaction interaction = new Interaction(power, target, success, callback);

            // If this interaction is blacklisted or in progress, return immediately
            if (blacklistedInteractions.Contains(interaction))
            {
                callback("blacklist");
                return;
            }
            if (curInteraction != null)
            {
                // TODO: Should we allow actions to queue up instead?
                callback("busy");
                return;
            }

            // Register this interaction as in-progress and run it
            curInteraction = interaction;
            world.Me.UsePower(power, target);

            // FIXME: We need an OnWorldUpdate event that will the in-progress interaction
            // and determine if it has completed, timed out, or is still in progress
        }
예제 #2
0
파일: Goal.cs 프로젝트: sdasd30/TSSG
 public void registerEvent(System.Type eventType, AIEventCallback callbackFunction)
 {
     if (!m_events.ContainsKey(eventType))
     {
         m_events[eventType] = new List <AIEventCallback>();
     }
     m_events[eventType].Add(callbackFunction);
 }
예제 #3
0
파일: AI.cs 프로젝트: jhurliman/d3research
 public Interaction(PowerName power, Actor target, InteractSuccessCallback success,
                    AIEventCallback callback)
 {
     Power    = power;
     Target   = target;
     Success  = success;
     Callback = callback;
     Started  = DateTime.UtcNow;
 }
예제 #4
0
파일: Goal.cs 프로젝트: sdasd30/TSSG
    public void deregisterEvent(System.Type eventType, AIEventCallback callbackFunction)
    {
        if (!m_events.ContainsKey(eventType))
        {
            return;
        }
        List <AIEventCallback> m_newList = new List <AIEventCallback>();

        foreach (AIEventCallback f in m_events[eventType])
        {
            if (f != callbackFunction)
            {
                m_newList.Add(f);
            }
        }
        m_events[eventType] = m_newList;
    }
예제 #5
0
파일: AI.cs 프로젝트: jhurliman/d3research
 public void BeginMoveTo(Actor target, AIEventCallback callback)
 {
 }
예제 #6
0
파일: AI.cs 프로젝트: jhurliman/d3research
 public void BeginMoveTo(Vector3f target, AIEventCallback callback)
 {
 }