示例#1
0
 public abstract bool TryMarkAsResolved(IEntityLookup entityLookup, Point currentAbsolutePosition, out MovementOrderBase newOrder);
示例#2
0
        public override bool TryMarkAsResolved(IEntityLookup entityLookup, Point currentAbsolutePosition, out MovementOrderBase newOrder)
        {
            newOrder = null;

            if (currentAbsolutePosition != InterceptPoint)
            {
                return(false);
            }

            var targetEntity           = entityLookup.GetEntity(TargetEntityId);
            var targetPosition         = targetEntity.GetRequiredComponent <EllipticalOrbitalPositionComponent>();
            var targetAbsolutePosition = targetPosition.GetCurrentAbsolutePosition(entityLookup);

            if (currentAbsolutePosition.IsWithinOneMeter(targetAbsolutePosition))
            {
                return(true);
            }

            Log.Info($"Reached InterceptPoint ({InterceptPoint.Value.X}, {InterceptPoint.Value.Y}), but target is not nearby ({targetAbsolutePosition.X}, {targetAbsolutePosition.Y})");
            newOrder = CloneWithIntercept(null);
            return(false);
        }