Exemple #1
0
 public AIStatic(string id, AIStaticType type)
     : base()
 {
     _identifier     = id;
     _type           = type;
     _radius         = 60;
     _aiobjects      = new List <AIObject>();
     _aiobjects_prev = new AIObject[100];
     IsSmallText     = true;
 }
Exemple #2
0
 public AIStatic(string id, AIStaticType type)
     : base()
 {
     _identifier = id;
     _type = type;
     _radius = 60;
     _aiobjects = new List<AIObject>();
     _aiobjects_prev = new AIObject[100];
     IsSmallText = true;
 }
Exemple #3
0
        private AIStatic GetNearestAvailableStatic(AIStaticType type)
        {
            AIStatic nearest  = null;
            float    min_dist = float.MaxValue;

            foreach (AIStatic aistatic in AIGame.AIContainer.AIStatics.FindAll(delegate(AIStatic ais) { return(ais.Type == type); }))
            {
                float real_dist = (aistatic.Position - Position).Length();
                if (real_dist < min_dist)
                {
                    nearest  = aistatic;
                    min_dist = real_dist;
                }
            }
            return(nearest);
        }
Exemple #4
0
        public AIStatic GetNearestStatic(Vector3 position, AIStaticType type)
        {
            AIStatic nearest  = null;
            float    min_dist = float.MaxValue;

            foreach (AIStatic aistatic in _aistatics)
            {
                if (aistatic.Type == type)
                {
                    float real_dist = (aistatic.Position - position).Length();
                    if (real_dist < min_dist)
                    {
                        nearest  = aistatic;
                        min_dist = real_dist;
                    }
                }
            }
            return(nearest);
        }
Exemple #5
0
        public AIStatic GetOtherNearestStatic(Vector3 position, AIStaticType type, List <AIStatic> not_this_ones)
        {
            AIStatic nearest  = null;
            float    min_dist = float.MaxValue;

            foreach (AIStatic aistatic in _aistatics)
            {
                if (not_this_ones.Contains(aistatic))
                {
                    continue;
                }
                if (aistatic.Type == type)
                {
                    float real_dist = (aistatic.Position - position).Length();
                    if (real_dist < min_dist)
                    {
                        nearest  = aistatic;
                        min_dist = real_dist;
                    }
                }
            }
            return(nearest);
        }
Exemple #6
0
 public AIStatic GetOtherNearestStatic(Vector3 position, AIStaticType type, List<AIStatic> not_this_ones)
 {
     AIStatic nearest = null;
     float min_dist = float.MaxValue;
     foreach (AIStatic aistatic in _aistatics)
     {
         if (not_this_ones.Contains(aistatic))
             continue;
         if (aistatic.Type == type)
         {
             float real_dist = (aistatic.Position - position).Length();
             if (real_dist < min_dist)
             {
                 nearest = aistatic;
                 min_dist = real_dist;
             }
         }
     }
     return nearest;
 }
Exemple #7
0
 public AIStatic GetNearestStatic(Vector3 position, AIStaticType type)
 {
     AIStatic nearest = null;
     float min_dist = float.MaxValue;
     foreach (AIStatic aistatic in _aistatics)
     {
         if (aistatic.Type == type)
         {
             float real_dist = (aistatic.Position - position).Length();
             if (real_dist < min_dist)
             {
                 nearest = aistatic;
                 min_dist = real_dist;
             }
         }
     }
     return nearest;
 }
Exemple #8
0
 public void AddAIStatic(string id, AIStaticType type)
 {
     _aistatics.Add(new AIStatic(id, type));
 }
Exemple #9
0
 public void AddAIStatic(string id, AIStaticType type)
 {
     _aistatics.Add(new AIStatic(id, type));
 }
Exemple #10
0
 private AIStatic GetNearestAvailableStatic(AIStaticType type)
 {
     AIStatic nearest = null;
     float min_dist = float.MaxValue;
     foreach (AIStatic aistatic in AIGame.AIContainer.AIStatics.FindAll(delegate(AIStatic ais) { return ais.Type == type;}))
     {
         float real_dist = (aistatic.Position - Position).Length();
         if (real_dist < min_dist)
         {
             nearest = aistatic;
             min_dist = real_dist;
         }
     }
     return nearest;
 }