Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long tryCheckPoint(TriggerInfo info, System.Func<boolean> timeout) throws java.io.IOException
        public override long TryCheckPoint(TriggerInfo info, System.Func <bool> timeout)
        {
            _ioLimiter.disableLimit();
            try
            {
                Resource lockAttempt = _mutex.tryCheckPoint();
                if (lockAttempt != null)
                {
                    using (Resource @lock = lockAttempt)
                    {
                        return(DoCheckPoint(info));
                    }
                }
                else
                {
                    using (Resource @lock = _mutex.tryCheckPoint(timeout))
                    {
                        if (@lock != null)
                        {
                            _msgLog.info(info.Describe(_lastCheckPointedTx) + " Check pointing was already running, completed now");
                            return(_lastCheckPointedTx);
                        }
                        else
                        {
                            return(-1);
                        }
                    }
                }
            }
            finally
            {
                _ioLimiter.enableLimit();
            }
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Creates a trigger collider gameobject and returns it
    /// </summary>
    /// <returns></returns>
    private GameObject CreateSphereTrigger(int type, int x, int z)
    {
        //create primitive gameobject
        GameObject trigger = new GameObject();

        //add collider component
        SphereCollider collider = trigger.AddComponent <SphereCollider>();

        //set collider size
        collider.radius = 1.4f;

        //set collider to trigger
        collider.isTrigger = true;

        //add and store trigger info
        TriggerInfo trigerInfo = trigger.AddComponent <TriggerInfo>();

        trigerInfo.gridType = type;
        trigerInfo.gridX    = x;
        trigerInfo.gridZ    = z;

        trigger.layer = LayerMask.NameToLayer("Triggers");

        return(trigger);
    }
Ejemplo n.º 3
0
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectRegion(RegionTypes.Battle, Territory.Op);

                    List <Card> targetCardList = SelectRegion.ThisRowCards;
                    int         hurtMaxValue   = twoSideVitality + 1;
                    for (int i = 0; i < Math.Min(targetCardList.Count, hurtMaxValue); i++)
                    {
                        await GameSystem.PointSystem.Hurt(new TriggerInfo(this, targetCardList[i], hurtMaxValue - i));
                    }
                }
            };
        }
Ejemplo n.º 4
0
 public JobInfo(JobKey id, JobDetailImpl job)
 {
     Id = id;
     Job = job;
     Triggers = new TriggerInfo[0];
     TriggerCount = 0;
 }
Ejemplo n.º 5
0
        public ActionResult Trigger(string url, int viewid, TriggerInfo triggerInfo)
        {
            TriggerService trgSvr = new TriggerService();

            trgSvr.Handler(url, viewid, triggerInfo);
            return(Json(new ResultModel()));
        }
Ejemplo n.º 6
0
        protected void SetEffectAnims(TriggerInfo triggerInfo, BattleAgentController self, BattleAgentController enemy)
        {
            // 播放技能对应的己方(释放技能方)技能特效动画
            switch (triggerInfo.triggerSource)
            {
            case SkillEffectTarget.Self:            //如果被动逻辑由自己执行
                if (selfEffectAnimName != string.Empty)
                {
                    self.SetEffectAnim(selfEffectAnimName);
                }
                if (enemyEffectAnimName != string.Empty)
                {
                    enemy.SetEffectAnim(enemyEffectAnimName);
                }
                break;

            // 播放技能对应的敌方(技能目标方)的技能特效动画
            case SkillEffectTarget.Enemy:            // 如果被动逻辑由对方执行
                if (selfEffectAnimName != string.Empty)
                {
                    enemy.SetEffectAnim(selfEffectAnimName);
                }
                if (enemyEffectAnimName != string.Empty)
                {
                    self.SetEffectAnim(enemyEffectAnimName);
                }
                break;
            }
        }
        } // DeleteUpload()

        #endregion // UPLOAD SUPPORT

        #region JOB SUPPORT
        /// <summary>Triggers a job.</summary>
        /// <param name="folderId">The folder identifier.</param>
        /// <param name="uploadId">The upload identifier.</param>
        /// <param name="details">The details.</param>
        /// <param name="groupName">The group name to chose while scheduling jobs.</param>
        /// <returns>An <see cref="Result" /> object.</returns>
        /// <remarks>The message property of the result contains the job id
        /// which is needed for further operations.</remarks>
        public Result TriggerJob(int folderId, int uploadId, TriggerInfo details, string groupName = "")
        {
            Log.Debug($"Triggering job for upload {uploadId}, folder={folderId}...");

            var json    = JsonConvert.SerializeObject(details);
            var request = new RestRequest(this.Url + "/jobs", Method.POST);

            request.RequestFormat  = DataFormat.Json;
            request.JsonSerializer = new JsonSerializer();
            request.Parameters.Clear();
            request.AddHeader("uploadId", uploadId.ToString());
            request.AddHeader("folderId", folderId.ToString());
            if (!string.IsNullOrEmpty(groupName))
            {
                request.AddHeader("groupName", groupName);
            } // if

            request.AddJsonBody(json);

            var response = this.api.Execute(request);
            var result   = JsonConvert.DeserializeObject <Result>(response.Content);

            Log.Debug($"TriggerInfo {result.Message} triggered.");

            return(result);
        } // TriggerJob()
    public override bool TriggersFrom(TriggerInfo info)
    {
        if (info.type != type)
        {
            return(false);
        }

        AfterDamageDealtTriggerInfo damage_info = info as AfterDamageDealtTriggerInfo;

        if (damage_info == null)
        {
            return(false);
        }

        if (damage_info.damager.entity_type == EntityType.player && !players)
        {
            return(false);
        }

        if (damage_info.damager as Creature != null && !creatures)
        {
            return(false);
        }

        return(damage_info.damage >= damage_needed_to_trigger);
    }
Ejemplo n.º 9
0
    private void OnSicknessTrigger(GameObject target, TriggerInfo trigger)
    {
        int      num      = UnityEngine.Random.Range(0, trigger.sickness_ids.Length);
        string   text     = trigger.sickness_ids[num];
        Sickness sickness = null;

        Database.Sicknesses sicknesses = Db.Get().Sicknesses;
        for (int i = 0; i < sicknesses.Count; i++)
        {
            if (sicknesses[i].Id == text)
            {
                sickness = sicknesses[i];
                break;
            }
        }
        if (sickness != null)
        {
            string infection_source_info       = trigger.sourceCallback(base.gameObject, target);
            SicknessExposureInfo exposure_info = new SicknessExposureInfo(sickness.Id, infection_source_info);
            Klei.AI.Sicknesses   sicknesses2   = target.GetComponent <MinionModifiers>().sicknesses;
            sicknesses2.Infect(exposure_info);
        }
        else
        {
            DebugUtil.DevLogErrorFormat(base.gameObject, "Couldn't find sickness with id [{0}]", text);
        }
    }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    int targetCount = cardSet[Orientation.My][RegionTypes.Battle][CardTag.Fairy].count;
                    Debug.Log("场上妖精数量为" + targetCount);
                    for (int i = 0; i < targetCount; i++)
                    {
                        if (basePoint > 1)
                        {
                            await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.Op][RegionTypes.Battle][CardRank.Silver, CardRank.Copper].CardList, 1, isAuto : true);

                            await GameSystem.PointSystem.Hurt(TriggerInfo.Build(this, SelectUnits, 1));

                            await GameSystem.PointSystem.Weak(TriggerInfo.Build(this, this, 1));
                        }
                    }
                }
            };
        }
Ejemplo n.º 11
0
    /// <summary>
    /// 延时心跳触发时间回调
    /// </summary>
    /// <param name="args"></param>
    static public void OnTriggerTimer(params object[] args)
    {
        if (args == null || args.Length < 2)
        {
            return;
        }

        ///检查是否包含触发节点
        string strTriggerName = args[0] as string;

        if (!mTriggers.ContainsKey(strTriggerName))
        {
            return;
        }

        ///触发用户接口
        TriggerInfo tInfo = mTriggers[strTriggerName];

        if (tInfo.onTrigger != null)
        {
            try
            {
                tInfo.onTrigger(strTriggerName);
            }
            catch (System.Exception ex)
            {
                LogSystem.LogError(ex.ToString());
            }
        }

        ///删除触发器和心跳
        mTriggers.Remove(strTriggerName);
        TimerManager.Destroy(strTriggerName);
    }
Ejemplo n.º 12
0
        public DeviceSettings(RFIDReader rfid)
        {
            _Parser = new ConfigParser();
            _ReaderAPI = rfid;
            setDefaults();

            //Construct access/post filter with no limit
            _Range = new RssiRangeFilter();
            _AccessFilter = new AccessFilter();
            _AccessFilter.UseRSSIRangeFilter = true;
            _AccessFilter.RssiRangeFilter = _Range;
            _PostFilter = new PostFilter();
            _PostFilter.UseRSSIRangeFilter = true;
            _PostFilter.RssiRangeFilter = _Range;

            //Will trigger inventory with trigger button
            _TriggerInfo = new TriggerInfo();
            _TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD;
            _TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;
            _TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT;
            _TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;

            //Read user membank sequence
            _Op = new TagAccess.Sequence.Operation();
            _Op.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;
            _Op.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;
            _Op.ReadAccessParams.ByteCount = 4;
            _Op.ReadAccessParams.ByteOffset = 0;
            _Op.ReadAccessParams.AccessPassword = 0;
        }
        protected override void ExcuteTriggeredSkillLogic(TriggerInfo triggerInfo, BattleAgentController self, BattleAgentController enemy)
        {
            // 判断被动是否生效
            if (!isEffective(triggeredProbability))
            {
                return;
            }

            SetEffectAnims(triggerInfo, self, enemy);

            // 如果没有状态名称,则默认不是触发状态,直接执行技能
            if (statusName == "")
            {
                Excute();
                return;
            }

            List <TriggeredSkill> sameStatusSkills = affectedAgent.propertyCalculator.GetTriggeredSkillsWithSameStatus(statusName);

            // 如果技能效果不可叠加,则被影响人身上原有的同种状态技能效果全部取消,并从战斗结算器中移除这些技能
            if (!canOverlay)
            {
                for (int i = 0; i < sameStatusSkills.Count; i++)
                {
                    TriggeredSkill ts = sameStatusSkills [i];
                    ts.CancelSkillEffect(ts == this);
                }
            }

            Excute();
        }
Ejemplo n.º 14
0
        private void ScheduleTextUpdate()
        {
            if (UserTextUpdater == null)
            {
                return;
            }

            if (UserTextUpdateResult != null)
            {
                if (UserTextUpdateResult.CallbackFinished)
                {
                    SetText(UserTextUpdateResult.ReturnValue.ToString());
                    UserTextUpdateResult = (guiCaused ?
                                            UserTextUpdater.TriggerOnFutureUpdate(InterruptPriority.CallbackOnce) :
                                            UserTextUpdater.TriggerOnNextOpcode(InterruptPriority.NoChange));
                }
                // Else just do nothing because a previous call is still pending its return result.
                // don't start up a second call while still waiting for the first one to finish.  (we
                // don't want to end up stacking up calls faster than they execute.)
            }
            else
            {
                UserTextUpdateResult = (guiCaused ?
                                        UserTextUpdater.TriggerOnFutureUpdate(InterruptPriority.CallbackOnce) :
                                        UserTextUpdater.TriggerOnNextOpcode(InterruptPriority.NoChange));
            }
        }
Ejemplo n.º 15
0
 public virtual void Resolve(TriggerInfo info)
 {
     for (int i = 0; i < effects.Count; i++)
     {
         effects[i].Resolve(source);
     }
 }
    public override bool TriggersFrom(TriggerInfo info)
    {
        if (info.type != type)
        {
            return(false);
        }

        AfterCharacterHealedTriggerInfo new_info = info as AfterCharacterHealedTriggerInfo;

        if (new_info == null)
        {
            return(false);
        }

        if (!players && new_info.healed.entity_type == EntityType.player)
        {
            return(false);
        }
        if (!creatures && new_info.healed.entity_type == EntityType.card)
        {
            return(false);
        }

        return(true);
    }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.My][RegionTypes.Battle][CardField.Vitality].CardList, 2, false);

                    foreach (var unite in SelectUnits)
                    {
                        await GameSystem.FieldSystem.Change(new TriggerInfo(this, unite, unite[CardField.Vitality] * 2));
                    }
                }
            };
        }
        public override void Init()
        {
            base.Init();

            this[CardField.Vitality] = 1;
            replaceDescribeValue     = this[CardField.Vitality];

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.My][RegionTypes.Battle][CardRank.Copper].CardList, 1);

                    await GameSystem.PointSystem.Cure(TriggerInfo.Build(this, SelectUnits));
                }
            };
        }
Ejemplo n.º 19
0
 public void KOSUpdate(double deltaTime)
 {
     if (camPositionDelegate == null)
     {
         camPositionTrigger = null;
     }
     else if (camPositionTrigger == null)
     {
         camPositionTrigger = camPositionDelegate.TriggerOnFutureUpdate(Safe.Execution.InterruptPriority.Normal);
     }
     else if (camPositionTrigger.CallbackFinished)
     {
         var result = camPositionTrigger.ReturnValue as Vector;
         if (result != null)
         {
             SetCameraPosition(result);
             camPositionTrigger = camPositionDelegate.TriggerOnFutureUpdate(Safe.Execution.InterruptPriority.Normal);
         }
         else
         {
             camPositionTrigger  = null;
             camPositionDelegate = null;
             throw new KOSInvalidDelegateType("FLIGHTCAMERA:POSITIONUPDATER", "Vector", camPositionTrigger.ReturnValue.KOSName);
         }
     }
 }
Ejemplo n.º 20
0
 private void OnMouseUp()
 {
     if (PlayerPlayCard != null)
     {
         //if (PlayerFocusRegion != null)
         //{
         if (PlayerFocusRegion != null && PlayerFocusRegion.name == "下方_墓地")
         {
             //print(name + "进入墓地");
             _ = Command.CardCommand.DisCard(thisCard);
         }
         else if (PlayerFocusRegion != null && (PlayerFocusRegion.name == "下方_领袖" || PlayerFocusRegion.name == "下方_手牌"))
         {
             PlayerPlayCard = null;
         }
         else
         {
             Debug.Log("1打出一张牌" + PlayerPlayCard);
             Task.Run(async() =>
             {
                 await GameSystem.TransSystem.PlayCard(TriggerInfo.Build(PlayerPlayCard, PlayerPlayCard));
                 Debug.LogError("我的回合结束啦!");
                 IsCardEffectCompleted = true;
             });
         }
     }
 }
Ejemplo n.º 21
0
    /// <summary>
    /// 触发同步
    /// </summary>
    /// <param name="strTriggerName"></param>
    /// <param name="onTrigger"></param>
    /// <param name="args"></param>
    static public void Trigger(string strTriggerName, OnTrigger onTrigger, params object[] args)
    {
        if (!mTriggers.ContainsKey(strTriggerName))
        {
            return;
        }

        ///检查是否可以触发
        TriggerInfo tInfo = mTriggers[strTriggerName];

        tInfo.iTriggerCount--;
        if (tInfo.iTriggerCount > 0)
        {
            return;
        }

        ///触发用户接口
        if (onTrigger != null)
        {
            try
            {
                onTrigger(args);
            }
            catch (System.Exception ex)
            {
                LogSystem.LogError(ex.ToString());
            }
        }
        ///清除触发器
        mTriggers.Remove(strTriggerName);
    }
Ejemplo n.º 22
0
    public IEnumerator FetchInitialData(Action <bool> callback = null)
    {
        bool userFetched = false, partsFetched = false, inventoryFetched = false, teamsFetched = false;

        yield return(runner.StartCoroutine(FetchCurrentUser(success => userFetched = success)));

        yield return(runner.StartCoroutine(FetchAllParts(success => partsFetched = success)));

        if (partsFetched)
        {
            TriggerInfo.LoadTriggers();
        }

        if (userFetched && partsFetched)
        {
            yield return(runner.StartCoroutine(FetchUserInventory(success => inventoryFetched = success)));

            yield return(runner.StartCoroutine(FetchUserTeams(success => teamsFetched = success)));
        }

        if (userFetched && partsFetched && inventoryFetched && teamsFetched)
        {
            initialDataFetched = true;
            callback?.Invoke(true);
        }
        else
        {
            callback?.Invoke(false);
        }
    }
Ejemplo n.º 23
0
    /// <summary>
    /// 开始拖动
    /// </summary>
    public void StartDrag()
    {
        if (currentGameStage != GameStage.Preparation)
        {
            return;
        }

        //获取当前鼠标指向
        TriggerInfo triggerinfo = inputController.triggerInfo;

        //当前鼠标指向一个触发器
        if (triggerinfo != null)
        {
            dragStartTrigger = triggerinfo;
            //获取指示灯上的物体
            GameObject championGO = GetChampionFromTriggerInfo(triggerinfo);

            if (championGO != null)
            {
                //show indicators
                map.ShowIndicators();

                draggedChampion = championGO;

                championGO.GetComponent <ChampionController>().IsDragged = true;
            }
        }
    }
    /// <summary>
    /// When we start dragging champions on map
    /// </summary>
    public void StartDrag()
    {
        if (currentGameStage != GameStage.Preparation)
        {
            return;
        }

        //get trigger info
        TriggerInfo triggerinfo = inputController.triggerInfo;

        //if mouse cursor on trigger
        if (triggerinfo != null)
        {
            dragStartTrigger = triggerinfo;

            GameObject championGO = GetChampionFromTriggerInfo(triggerinfo);

            if (championGO != null)
            {
                //show indicators
                map.ShowIndicators();

                draggedChampion = championGO;

                //isDragging = true;

                championGO.GetComponent <ChampionController>().IsDragged = true;
                //Debug.Log("STARTDRAG");
            }
        }
    }
Ejemplo n.º 25
0
    /// <summary>
    /// Two TriggerInfos shall be considered equivalent (and thus disallowed
    /// from existing simultaneously in collections that demand uniqueness) if
    /// they are non-callback triggers that refer to the same entry
    /// point.  For callback triggers, ANY two callbacks that are not the
    /// same reference shall be consided unequal.
    /// The closure field is not compared because it should be hypothetically
    /// impossible for two triggers that call the same IP location to have
    /// differing closures unless we really did something wrong when we created
    /// those closures in the first place.
    /// </summary>
    /// <param name="other"></param>
    /// <returns></returns>
    public override bool Equals(object other)
    {
        TriggerInfo otherInfo = other as TriggerInfo;

        if (otherInfo == null)
        {
            return(false);
        }

        if (IsCSharpCallback)
        {
            // For callbacks, only reference-equals are good enough.
            // Hypothetically the same chunk of user code (same entry point)
            // could have been given as a callback to two different areas of
            // our C# code, and if so we still want them to be two different
            // callbacks tracked separately.
            if (otherInfo != this)
            {
                return(false);
            }
        }
        else
        {
            // for non-callbacks, as long as they refer to the same
            // chunk of user code, they are equal:
            if (EntryPoint != otherInfo.EntryPoint)
            {
                return(false);
            }
        }

        return(true);
    }
Ejemplo n.º 26
0
        public void KOSFixedUpdate(double deltaTime)
        {
            // Execute just one hook at a time per update, to keep it sane and to keep the
            // multiple Shared.Screen.AddResizeNotifier firings that happen per fixedupdate
            // from resulting in the same hook stepping on top of itself:  This means it may
            // take a few fixedupdates to finish processing all the fired off events, but
            // it's less messy to track than the alternative.

            // Only schedule the call to the next one if the previous one isn't still waiting:
            if (currentResizeTrigger == null || currentResizeTrigger.CallbackFinished)
            {
                if (pendingResizeTriggers.Count == 0)
                {
                    currentResizeTrigger = null;
                }
                else
                {
                    currentResizeTrigger = pendingResizeTriggers.Dequeue();

                    // Try calling it again, and by the way any time we notice an attempt
                    // to call it again has failed, then go back and trim our list of
                    // watchers so it won't happen again:
                    if (Shared.Cpu.AddTrigger(currentResizeTrigger, false) == null)
                    {
                        TrimStaleWatchers();
                    }
                }
            }
        }
Ejemplo n.º 27
0
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    for (int i = 0; i < twoSideVitality + 1; i++)
                    {
                        await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.Op][RegionTypes.Battle][CardRank.Copper, CardRank.Silver][CardFeature.Largest].CardList, 1, true);

                        await GameSystem.PointSystem.Hurt(new TriggerInfo(this, SelectUnits, 1));
                    }
                }
            };
        }
Ejemplo n.º 28
0
        public static List <TriggerInfo> GetAllTriggers(this IScheduler scheduler)
        {
            List <TriggerInfo> tr = new List <TriggerInfo>();

            var allTriggerKeys = scheduler.GetTriggerKeys(GroupMatcher <TriggerKey> .AnyGroup());

            foreach (var triggerKey in allTriggerKeys)
            {
                var triggerdetails = scheduler.GetTrigger(triggerKey);
                var Jobdetails     = scheduler.GetJobDetail(triggerdetails.JobKey);


                var state = scheduler.GetTriggerState(triggerKey);


                TriggerInfo ti = new TriggerInfo();
                ti.TriggerKey = triggerdetails.Key.Name;
                ti.JobName    = triggerdetails.JobKey.Name;
                ti.State      = state.ToString();

                var date = triggerdetails.GetNextFireTimeUtc()?.DateTime;
                if (date.HasValue)
                {
                    ti.NextFireTimeUTC = date.Value.ToLocalTime().ToString();
                }



                tr.Add(ti);

                // Console.WriteLine("IsCompleted -" + triggerdetails.IsCompleted + " |  TriggerKey  - " + triggerdetails.Result.Key.Name + " Job key -" + triggerdetails.Result.JobKey.Name);
            }

            return(tr);
        }
    public override bool TriggersFrom(TriggerInfo info)
    {
        if (info.type != type)
        {
            return(false);
        }

        WheneverCreatureSummonedInfo new_info = info as WheneverCreatureSummonedInfo;

        if (!yours && source.controller == new_info.creature.controller)
        {
            return(false);
        }
        if (!thiers && source.controller != new_info.creature.controller)
        {
            return(false);
        }

        if (match_creature_type && creature_type != new_info.creature.creature_type)
        {
            return(false);
        }

        return(true);
    }
        public void TestTriggerJob()
        {
            var client = new FossologyClient(LocalUrl, Token);
            var job    = new TriggerInfo();

            job.Analysis.Bucket = true;
            job.Analysis.CopyrightEmailAuthor = true;
            job.Analysis.Ecc        = true;
            job.Analysis.Keyword    = true;
            job.Analysis.Mime       = true;
            job.Analysis.Monk       = true;
            job.Analysis.Nomos      = true;
            job.Analysis.Ojo        = true;
            job.Analysis.Package    = true;
            job.Decider.NomosMonk   = true;
            job.Decider.BulkReused  = true;
            job.Decider.NewScanner  = true;
            job.Decider.OjoDecider  = true;
            job.Reuse.ReuseUploadId = 0;
            job.Reuse.ReuseGroup    = 0;
            job.Reuse.ReuseMain     = true;
            job.Reuse.ReuseEnhanced = true;
            var result = client.TriggerJob(3, 2, job, "fossy");

            Assert.IsNotNull(result);
            Assert.AreEqual("INFO", result.Type);
            Assert.AreEqual(201, result.Code);
            Debug.WriteLine($"TriggerInfo job id = {result.Message}");
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    for (int i = 0; i < 1 + twoSideVitality; i++)
                    {
                        await GameSystem.SelectSystem.SelectUnite(this, cardSet[RegionTypes.Battle].CardList, 1, false);

                        await GameSystem.StateSystem.SealCard(new TriggerInfo(this, SelectUnits, 1));
                    }
                }
            };
        }
Ejemplo n.º 32
0
        protected override void ExcuteTriggeredSkillLogic(TriggerInfo triggerInfo, BattleAgentController self, BattleAgentController enemy)
        {
            if (isEffective(triggeredProbability))
            {
                List <TriggeredSkill> fizzySkills = enemy.propertyCalculator.GetTriggeredSkillsWithSameStatus(statusName);

                affectedAgent = GetAffectedBattleAgent(triggerInfo, self, enemy);

                if (fizzySkills.Count > 0)
                {
                    for (int i = 0; i < fizzySkills.Count; i++)
                    {
                        TriggeredSkill ts = fizzySkills [i];
                        ts.CancelSkillEffect(ts != this);
                    }
                }
                else
                {
                    affectedAgent.propertyCalculator.SkillTriggered <TriggeredSkill> (this);
                }


                affectedAgent.PlayRoleAnim("stun", 0, null);
                affectedAgent.isAttackActionFinish = false;

                fizzyCoroutine = StartCoroutine("FizzyForDuration", affectedAgent);

                SetEffectAnims(triggerInfo, self, enemy);
            }
        }
Ejemplo n.º 33
0
        internal void Write(TriggerInfo trigger, XmlWriter writer)
        {
            writer.WriteStartElement("Trigger");
            writer.WriteAttributeString("priority", trigger.Priority.ToString());

            writer.WriteElementString("Condition", trigger.Condition);
            _effectXmlWriter.Write(trigger.Effect, writer);

            if (trigger.Else != null)
                _effectXmlWriter.WriteElse(trigger.Else, writer);

            writer.WriteEndElement();
        }
Ejemplo n.º 34
0
 void ExitFromTrigger(TriggerInfo i)
 {
     Debug.Log("Exit from trigger " + i.Body.name);
 }
Ejemplo n.º 35
0
 public override CustomObjectInfo SerializeObject()
 {
     TriggerInfo z = new TriggerInfo();
     z.BasicSerialization(this);
     if (texture != null)
       z.texture = texture.name;
     else
       z.texture = "";
     z.TargetTriggerName=TargetTriggerName;
     z.MultiUseTrigger=MultiUseTrigger;
     z.OnObjectStay=OnObjectStay;
     z.ActivateOnStart=ActivateOnStart;
     z.delay=delay;
     z.toActivate=toActivate.ConvertAll<int>(x=>x.ObjectID);
     z.toDeactivate=toDeactivate.ConvertAll<int>(x=>x.ObjectID);
     z.toDestroy=toDestroy.ConvertAll<int>(x=>x.ObjectID);
     return z;
 }
Ejemplo n.º 36
0
 void EnterToTrigger(TriggerInfo i)
 {
     Debug.Log("Enter to trigger " + i.Body.name);
 }
Ejemplo n.º 37
0
 void StayInTrigger(TriggerInfo i)
 {
     //Debug.Log("Stay in trigger " + i.Body.name);
 }
        private void Initialize()
        {
            try
            {
                if (_reader != null)
                {
                    _reader.Events.ReadNotify -= new Events.ReadNotifyHandler(Events_ReadNotify);
                }

                //create RFIDReader using the default values and connect
                _reader = new RFIDReader(hostname, port, timeoutMs);
                _reader.Connect();

                //We are going to read just individual tags, attach tag data with read event
                _reader.Events.AttachTagDataWithReadEvent = true;

                //register read tag event notification
                _reader.Events.ReadNotify += new Events.ReadNotifyHandler(Events_ReadNotify);

                //Set up start and stop triggers to be handheld trigger
                _triggerInfo = new TriggerInfo();

                _triggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD;
                _triggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;

                _triggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT;
                _triggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;
                _triggerInfo.StopTrigger.Handheld.Timeout = 0; // 0 = no timeout setting

                /* Setup inventory operation on the reader on the connected antenna, using the handheld trigger.
                 * Inventory starts when the handheld trigger is pressed and stops when released */
                _reader.Actions.Inventory.Perform(null, _triggerInfo, null);

            }
            catch (OperationFailureException ex)
            {
                throw new ApplicationException(String.Format("RFIDReader Initialization Error:{0}", ex.StatusDescription));
            }
        }
Ejemplo n.º 39
0
 private Trigger ParseTrigger(TriggerInfo info)
 {
     try
     {
         var condition = EffectParser.ParseCondition(info.Condition);
         var effect = EffectParser.LoadTriggerEffect(info.Effect);
         var elseEffect = (info.Else != null) ? EffectParser.LoadTriggerEffect(info.Else) : null;
         return new Trigger { Condition = condition, Effect = effect, Else = elseEffect, ConditionString = info.Condition, Priority = info.Priority ?? 0 };
     }
     catch (Exception e)
     {
         throw new GameRunException("There was an error parsing a trigger. There may be a syntax error in your condition expression.\n\nThe error message was:\n\n\t" + e.Message);
     }
 }