Defines the weapons. Both hand-held by characters or guns established on turret are weapons.
Inheritance: Dynamic
Ejemplo n.º 1
0
 public AttackTask( Weapon weapon, Dynamic target )
 {
     this.weapon = weapon;
     this.targetPosition = new Vec3( float.NaN, float.NaN, float.NaN );
     this.targetEntity = target;
 }
Ejemplo n.º 2
0
        void DoAttackTask( Weapon weapon, Dynamic target )
        {
            AttackTask task = attackTasks.Find( delegate( AttackTask t )
            {
                return t.Weapon == weapon;
            } );

            if( task != null && task.TargetEntity == target )
                return;

            if( task != null )
                ResetAttackTask( task );

            task = new AttackTask( weapon, target );
            AddRelationship( target );
            attackTasks.Add( task );
        }
Ejemplo n.º 3
0
 //
 public AttackTask( Weapon weapon, Vec3 target )
 {
     this.weapon = weapon;
     this.targetPosition = target;
     this.targetEntity = null;
 }
Ejemplo n.º 4
0
        void DoAttackTask( Weapon weapon, Vec3 target )
        {
            AttackTask task = attackTasks.Find( delegate( AttackTask t )
            {
                return t.Weapon == weapon;
            } );

            if( task != null && task.TargetPosition == target )
                return;

            ResetAttackTask( task );

            task = new AttackTask( weapon, target );
            attackTasks.Add( task );
        }