public AttackTask( Weapon weapon, Dynamic target ) { this.weapon = weapon; this.targetPosition = new Vec3( float.NaN, float.NaN, float.NaN ); this.targetEntity = target; }
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 ); }
// public AttackTask( Weapon weapon, Vec3 target ) { this.weapon = weapon; this.targetPosition = target; this.targetEntity = null; }
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 ); }