コード例 #1
0
ファイル: Avoidance.cs プロジェクト: Buddernutz/Cardinal
        public static Composite GetBehavior(AvoidanceContext context)
        {
            var reportUnknown = new Action(r => context.Capture.CaptureScreenshot(context));
            var update        = new Action(r => context.Update());
            var move          = CommonBehaviors.MoveAndStop(r => context.SafeLocation, 1f, true);
            var avoidCheck    = new PrioritySelector(new Decorator(req => context.IsAvoiding, move),
                                                     new Decorator(req => context.IsWaiting, new Action(r => RunStatus.Success)));

            return(new Sequence(update, avoidCheck));
        }
コード例 #2
0
        public RunStatus CaptureScreenshot(AvoidanceContext context)
        {
            if (context.UnknownCast == null)
            {
                return(RunStatus.Success);
            }
            string name = string.Format("{0} ({1})", context.UnknownCast.SpellId, context.UnknownCast.Name);

            TakeScreenshot(name);

            return(RunStatus.Success);
        }