Esempio n. 1
0
 public void EvadeOff()
 {
     if (On(behavior_type.evade))
     {
         flags ^= behavior_type.evade;
     }
 }
Esempio n. 2
0
 public void ArriveOff()
 {
     if (On(behavior_type.arrive))
     {
         flags ^= behavior_type.arrive;
     }
 }
Esempio n. 3
0
 public void PursuitOff()
 {
     if (On(behavior_type.pursuit))
     {
         flags ^= behavior_type.pursuit;
     }
 }
Esempio n. 4
0
 public void FleeOff()
 {
     if (On(behavior_type.flee))
     {
         flags ^= behavior_type.flee;
     }
 }
Esempio n. 5
0
 public void SeekOff()
 {
     if (On(behavior_type.seek))
     {
         flags ^= behavior_type.seek;
     }
 }
Esempio n. 6
0
 public void WanderOff()
 {
     if (On(behavior_type.wander))
     {
         flags ^= behavior_type.wander;
     }
 }
Esempio n. 7
0
        public SteeringBehavior(Vehicle vehicle)
        {
            this.vehicle      = vehicle;
            this.flags        = behavior_type.none;
            this.TargetAgent1 = null;
            //this.targetAgent2 = null;
            this.target = Vector2.Empty;

            //stuff for the wander behavior
            double theta = random.NextDouble() * 2.0 * Math.PI;

            //create a vector to a target position on the wander circle
            wanderTarget = new Vector2((float)(wanderRadius * Math.Cos(theta)),
                                       (float)(wanderRadius * Math.Sin(theta)));
        }
Esempio n. 8
0
 public void WanderOn()
 {
     flags |= behavior_type.wander;
 }
 bool On(behavior_type bt)
 {
     return((flags & (int)bt) == (int)bt);
 }
Esempio n. 10
0
 public void PursuitOn()
 {
     flags |= behavior_type.pursuit;
 }
Esempio n. 11
0
 public void ArriveOn()
 {
     flags |= behavior_type.arrive;
 }
Esempio n. 12
0
 public void SeekOn()
 {
     flags |= behavior_type.seek;
 }
Esempio n. 13
0
 public void FleeOn()
 {
     flags |= behavior_type.flee;
 }
Esempio n. 14
0
 bool On(behavior_type bt)
 {
     return((flags & bt) == bt);
 }
Esempio n. 15
0
 //this function tests if a specific bit of m_iFlags is set
 private bool On(behavior_type bt) { return (m_iFlags & (int)bt) == (int)bt; }
Esempio n. 16
0
 //检测某个属性是否开启
 private bool On(behavior_type type)
 {
     return ((m_flags & (int)type) == (int)type);
 }
Esempio n. 17
0
 public void EvadeOn()
 {
     flags |= behavior_type.evade;
 }
Esempio n. 18
0
 bool On(behavior_type type)
 {
     return((m_iFlags & ((int)type)) == (int)type);
 }