// Path: src/upgrades/GunUpgrade.java
// public class GunUpgrade extends Upgrade {
// 
//     public GunUpgrade() {
//         super();
//         _name = "Default Gun";
//         _description = "No changes at all!";
//     }
// 
//     /*
//      * Returns the number of shots this upgrade allows for.
//      * Highest should be chosen
//      */
//     public int getNumShots() {
//         return 1;
//     }
// 
//     /*
//      * Gives an angle this ship should aim at, measured in radians,
//      * From the vertical axis.
//      * Called for each shot, so it should probably keep track of which one it's at.
//      * Should be chosen based on getNumShots
//      */
//     public double getAimAngle() {
//         return 0;
//     }
// 
//     /*
//      * Gives the name of the bullet sprites, as an array to be cycled through.
//      */
//     public String[] getSprites(String[] sprites) {
//         return sprites;
//     }
// 
//     /*
//      * Gives a number of coordinates to offset the shot's origin
//      * on the X axis from wherever shots would normally come from.
//      * Not garunteed to return the same thing each time, should probably keep track of which shot this is (like getAimAngle)
//      * Should be chosen based off of getNumShots
//      */
//     public double getXOffset() {
//         return 0;
//     }
// 
//     /*
//      * Get the cooldown between shots, in ticks, based off the previous one
//      */
//     public double getCooldown(double cooldown) {
//         return cooldown;
//     }
// 
//     /*
//      * Get the speed the shot should move at
//      */
//     public double getShotSpeed(double shotspeed) {
//         return shotspeed;
//     }
// 
//     /*
//      * Returns whether or not this upgrade causes shots to seek a target.
//      */
//     public boolean getSeeking(boolean seeking) {
//         return seeking;
//     }
// 
//     /*
//      * Get the max turn angle of bullets created by this upgrade, in
//      * radians per tick.
//      */
//     public double getAgility(double agility) {
//         return agility;
//     }
// 
//     @Override
//     public Upgrade clone() {
//         return new GunUpgrade();
//     }
// }
// 
// Path: src/upgrades/Upgrade.java
// public class Upgrade {
//     protected String _name, _description;
//     protected boolean _ownedByPlayer;
// 
//     public Upgrade() {
//         _name = "Unnamed Upgrade";
//         _description = "Upgrade!";
//         _ownedByPlayer = false;
//     }
// 
//     /*
//      * Get the name of the upgrade
//      */
//     public String getName() {
//         return _name;
//     }
//     /*
//      * Get a description to pop up when the upgrade is gathered.
//      * Should be quick, and maybe funny
//      * If this is an empty string, don't show anything at all
//      */
//     public String getDescription() {
//         return _description;
//     }
// 
//     public boolean getOwnedByPlayer() {
//         return _ownedByPlayer;
//     }
// 
//     public void setOwnedByPlayer(boolean owned) {
//         _ownedByPlayer = owned;
//     }
// 
//     public String getSpriteName() {
//         return "upgrade/generic";
//     }
// 
//     public Upgrade clone() {
//         return new Upgrade();
//     }
// 
// }


import java.util.LinkedList;
import java.util.Iterator;
import edu.stuy.starlorn.upgrades.GunUpgrade;
import edu.stuy.starlorn.upgrades.Upgrade;
        cooldownTimer = 0;
        maxSpeed = 10;
        shootRequested = false;
    }

    public Ship(String name) {
        this(0, 0, name);
    }

    public Ship(double x, double y) {
        this(x, y, null);
    }

    public Ship() {
        this(null);
    }

    protected void clone(Ship s) {
        s.sprite = sprite;
        s.baseShotSpeed = baseShotSpeed;
        s.baseCooldown = baseCooldown;
        s.maxSpeed = maxSpeed;
        s.baseAim = baseAim;
        for (GunUpgrade up : gunUpgrades)
            s.addUpgrade(up.clone());
    }

    public void addUpgrade(Upgrade upgrade) {
        upgrade.setOwnedByPlayer(isPlayer());
        if (upgrade instanceof GunUpgrade)
// Path: src/upgrades/GunUpgrade.java
// public class GunUpgrade extends Upgrade {
// 
//     public GunUpgrade() {
//         super();
//         _name = "Default Gun";
//         _description = "No changes at all!";
//     }
// 
//     /*
//      * Returns the number of shots this upgrade allows for.
//      * Highest should be chosen
//      */
//     public int getNumShots() {
//         return 1;
//     }
// 
//     /*
//      * Gives an angle this ship should aim at, measured in radians,
//      * From the vertical axis.
//      * Called for each shot, so it should probably keep track of which one it's at.
//      * Should be chosen based on getNumShots
//      */
//     public double getAimAngle() {
//         return 0;
//     }
// 
//     /*
//      * Gives the name of the bullet sprites, as an array to be cycled through.
//      */
//     public String[] getSprites(String[] sprites) {
//         return sprites;
//     }
// 
//     /*
//      * Gives a number of coordinates to offset the shot's origin
//      * on the X axis from wherever shots would normally come from.
//      * Not garunteed to return the same thing each time, should probably keep track of which shot this is (like getAimAngle)
//      * Should be chosen based off of getNumShots
//      */
//     public double getXOffset() {
//         return 0;
//     }
// 
//     /*
//      * Get the cooldown between shots, in ticks, based off the previous one
//      */
//     public double getCooldown(double cooldown) {
//         return cooldown;
//     }
// 
//     /*
//      * Get the speed the shot should move at
//      */
//     public double getShotSpeed(double shotspeed) {
//         return shotspeed;
//     }
// 
//     /*
//      * Returns whether or not this upgrade causes shots to seek a target.
//      */
//     public boolean getSeeking(boolean seeking) {
//         return seeking;
//     }
// 
//     /*
//      * Get the max turn angle of bullets created by this upgrade, in
//      * radians per tick.
//      */
//     public double getAgility(double agility) {
//         return agility;
//     }
// 
//     @Override
//     public Upgrade clone() {
//         return new GunUpgrade();
//     }
// }
// 
// Path: src/upgrades/Upgrade.java
// public class Upgrade {
//     protected String _name, _description;
//     protected boolean _ownedByPlayer;
// 
//     public Upgrade() {
//         _name = "Unnamed Upgrade";
//         _description = "Upgrade!";
//         _ownedByPlayer = false;
//     }
// 
//     /*
//      * Get the name of the upgrade
//      */
//     public String getName() {
//         return _name;
//     }
//     /*
//      * Get a description to pop up when the upgrade is gathered.
//      * Should be quick, and maybe funny
//      * If this is an empty string, don't show anything at all
//      */
//     public String getDescription() {
//         return _description;
//     }
// 
//     public boolean getOwnedByPlayer() {
//         return _ownedByPlayer;
//     }
// 
//     public void setOwnedByPlayer(boolean owned) {
//         _ownedByPlayer = owned;
//     }
// 
//     public String getSpriteName() {
//         return "upgrade/generic";
//     }
// 
//     public Upgrade clone() {
//         return new Upgrade();
//     }
// 
// }


// Path: src/entities/Ship.java
import java.util.LinkedList;
import java.util.Iterator;
import edu.stuy.starlorn.upgrades.GunUpgrade;
import edu.stuy.starlorn.upgrades.Upgrade;

        cooldownTimer = 0;
        maxSpeed = 10;
        shootRequested = false;
    }

    public Ship(String name) {
        this(0, 0, name);
    }

    public Ship(double x, double y) {
        this(x, y, null);
    }

    public Ship() {
        this(null);
    }

    protected void clone(Ship s) {
        s.sprite = sprite;
        s.baseShotSpeed = baseShotSpeed;
        s.baseCooldown = baseCooldown;
        s.maxSpeed = maxSpeed;
        s.baseAim = baseAim;
        for (GunUpgrade up : gunUpgrades)
            s.addUpgrade(up.clone());
    }

    public void addUpgrade(Upgrade upgrade) {
        upgrade.setOwnedByPlayer(isPlayer());
        if (upgrade instanceof GunUpgrade)
            gunUpgrades.add((GunUpgrade) upgrade);