Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sonc.battle;
- import java.awt.Color;
- public class Bullet extends Munition{
- int fireDelay;
- int damage;
- int impactDamage;
- int size;
- static double inicialSpeed;
- double maxRotation;
- double maxSpeed;
- double maxSpeedChange;
- public static Color color;
- /*FALTA Bullet
- public Bullet(double heading)
- Create a bullet with a certain heading. The initial position with be that of the ship that fires the missile.
- Parameters:
- heading - of the bullet
- */
- /**
- * @param fireDelay
- * @param damage
- * @param impactDamage
- * @param size
- * @param maxRotation
- * @param maxSpeed
- * @param maxSpeedChange
- */
- public Bullet(int fireDelay, int damage, int impactDamage, int size, double maxRotation, double maxSpeed,
- double maxSpeedChange) {
- super();
- this.fireDelay = fireDelay;
- this.damage = damage;
- this.impactDamage = impactDamage;
- this.size = size;
- this.maxRotation = maxRotation;
- this.maxSpeed = maxSpeed;
- this.maxSpeedChange = maxSpeedChange;
- }
- /**
- * Get the delay for firing this king of munition.
- * @return delay in number of rounds
- */
- public int getFireDelay() {
- return fireDelay;
- }
- /**
- * @param fireDelay
- * Set the delay for firing this king of munition. This method should be invoked before any battle.
- */
- public void setFireDelay(int fireDelay) {
- this.fireDelay = fireDelay;
- }
- /**
- * Get the damage inflicted by a guided missile in the status of ship it hits.
- * @return damage inflicted by a guided missile
- */
- public int getDamage() {
- return damage;
- }
- /**
- * @param damage
- * Set the damage inflicted by a bullet in the status of ship it hits. This method should be invoked before any battle.
- */
- public void setDamage(int damage) {
- this.damage = damage;
- }
- /**
- * Damage inflicted by this moving object when it hits another
- * @return amount of status removed from another moving object on collision
- */
- public int getImpactDamage() {
- return impactDamage;
- }
- /**
- * Size of this moving object when displayed. Moving objects are represented as elongated objects (imagine a cigar) with this size
- * @return size of this moving object
- */
- public int getSize() {
- return size;
- }
- /**
- * Get the initial speed of a guided missile.
- * @return speed of a guided missile
- */
- public static double getInicialSpeed() {
- return inicialSpeed;
- }
- /**
- * Set the initial speed of a guided missile. This method should be invoked before any battle.
- * @param inicialSpeed
- */
- public static void setInicialSpeed(double inicialSpeed) {
- Bullet.inicialSpeed = inicialSpeed;
- }
- /**
- *The maximum rotation per turn of this moving object
- * @return maximum rotation
- */
- public double getMaxRotation() {
- @Override
- return maxRotation;
- }
- /**
- * The maximum speed of this moving object in absolute value. Ships may have negative speed when sailing backwards but the absolute value of the sped cannot exceed this value.
- * @return maximum speed variation
- */
- public double getMaxSpeed() {
- return maxSpeed;
- }
- /**
- * The maximum speed variation in absolute value, per turn, of this moving object
- * @return maximum speed variation
- */
- public double getMaxSpeedChange() {
- @Overrides
- return maxSpeedChange;
- }
- /**
- *
- Color of this moving objects. Different ships may have their own color but most other have colors depending on their type. Colors may be set as an HTML/CSS color (e.g. "#0000FF") or a name for some basic colors (e.g. "yellow" or "red").
- * @return color as a HTML/CSS string or basic color
- */
- public static Color getColor() {
- return color;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement