-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
foreach (Actor actor in Actors)
{
actor.Draw(spriteBatch);
+
+ if (actor.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainActor = (MainShip)actor;
+ mainActor.ResetEnemyModification ();
+ }
}
}
var angle = (float) Math.Atan2(dy, dx);
var otherAngle = (float)Math.Atan2(-dy, -dx);
+ if (actor.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainActor = (MainShip)actor;
+ mainActor.UpdateEnemyModification (other);
+ }
+
+ if (other.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainOther = (MainShip)other;
+ mainOther.UpdateEnemyModification (actor);
+ }
+
if (linearDistance < actor.MagneticRadius || linearDistance < other.MagneticRadius)
{
actor.Magnetize(other, (float)linearDistance, angle);