public override void collisionCheck(spaceObject obj) { if (this == obj) return; if (obj is spaceObjectHasList) { locations = (obj as spaceObjectHasList).getList(); for (int i = 0; i < locations.Count(); ++i) { if ((globCenterX - locations[i].posX) * (globCenterX - locations[i].posX) + (globCenterY - locations[i].posY) * (globCenterY - locations[i].posY) < colRadius * colRadius + obj.colRadius * obj.colRadius) { collide(); (obj as spaceObjectHasList).collide(locations[i]); } } } else { if ((posX - obj.posX) * (posX - obj.posX) + (posY - obj.posY) * (posY - obj.posY) < colRadius * colRadius + obj.colRadius * obj.colRadius) { collide(); obj.collide(); } } }
public override void collisionCheck(spaceObject obj) { base.collisionCheck(obj); }
public virtual void collisionCheck(spaceObject obj) { }