Defines the weapons. Both hand-held by characters or guns established on turret are weapons.
Inheritance: Dynamic
Example #1
0
 public AttackTask( Weapon weapon, Dynamic target )
 {
     this.weapon = weapon;
     this.targetPosition = new Vec3( float.NaN, float.NaN, float.NaN );
     this.targetEntity = target;
 }
Example #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 );
        }
Example #3
0
 //
 public AttackTask( Weapon weapon, Vec3 target )
 {
     this.weapon = weapon;
     this.targetPosition = target;
     this.targetEntity = null;
 }
Example #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 );
        }