コード例 #1
0
        public override BehaviorPriority DeterminePriority(BehaviorContext context)
        {
            foreach (Entity other in Entity.Universe.GetEntities())
            {
                if (other.Has <AiComponent>())
                {
                    continue;
                }

                var offset = Entity.Get <PositionComponent>().Placement.Pos - other.Get <PositionComponent>().Placement.Pos;

                if (offset.Length < 4)
                {
                    return(BehaviorPriority.Value(4));
                }
            }

            return(BehaviorPriority.NA);
        }
コード例 #2
0
        public override BehaviorPriority DeterminePriority(BehaviorContext context)
        {
            foreach (Entity other in context.OtherEntities)
            {
                if (other.IsAiControlled)
                {
                    continue;
                }

                var offset = Entity.PositionData.Placement.Pos - other.PositionData.Placement.Pos;

                if (offset.Length < 4)
                {
                    return(BehaviorPriority.Value(4));
                }
            }

            return(BehaviorPriority.NA);
        }
コード例 #3
0
 public override BehaviorPriority DeterminePriority(BehaviorContext context)
 {
     return(BehaviorPriority.Value(1));
 }