예제 #1
0
        private string executeMoveResult(CMoveResult cmr, uint gid)
        {
            try
            {
                if (aiLogging_)
                {
                    alogger_.info("GMR Result " + cmr.result_ + " for gid " + gid);
                }

                recurseCount++;
                if (recurseCount > 3)
                {
                    if (aiLogging_)
                    {
                        alogger_.info("Recurse Count Exceeded`: " + recurseCount);
                    }
                    return(COrderConstants.MV_FAILURE);
                }

                if (cmr.error_ != null)
                {
                    if (aiLogging_)
                    {
                        alogger_.info("On exe gmr Unit Order: Error->: " + cmr.error_);
                    }
                    return(cmr.result_);
                }

                //process gmr events
                processEvents(cmr.events_, alogger_);
                //process other events
                pollAllEvents();

                return(cmr.result_);
            }
            finally
            {
                recurseCount--;
            }
        }
예제 #2
0
        public string setAndExecuteUnitOrder(uint gid, COrder ord)
        {
            CMoveResult cmr = command_.setAndExecuteOrder(position_, gid, ord);

            return(executeMoveResult(cmr, gid));
        }
예제 #3
0
        public string executeUnitOrder(uint gid)
        {
            CMoveResult cmr = command_.executeOrder(position_, gid);

            return(executeMoveResult(cmr, gid));
        }