Class Ship

java.lang.Object
dev.bbzbl.m320.Ship

public class Ship extends Object
Class which contains the logic of a ship.
Version:
1.0
Author:
yannick
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ship(int nr, String name)
    Constructor to create a new Ship
  • Method Summary

    Modifier and Type
    Method
    Description
    Getter Method for the ship name
    int
    Getter for Number
    int
    Method to get the time
    void
    Method to start a new race and to generate a new time
    void
    Setter Method for the ship name
    void
    setNr(int nr)
    Set the ship number

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Ship

      public Ship(int nr, String name)
      Constructor to create a new Ship
      Parameters:
      nr - the ship number
      name - the name of the ship
  • Method Details

    • getNr

      public int getNr()
      Getter for Number
      Returns:
      the ship number
    • setNr

      public void setNr(int nr)
      Set the ship number
      Parameters:
      nr - the number of the ship
    • getName

      public String getName()
      Getter Method for the ship name
      Returns:
      the ship name
    • setName

      public void setName(String name)
      Setter Method for the ship name
      Parameters:
      name - the name of the ship
    • race

      public void race()
      Method to start a new race and to generate a new time
    • getTime

      public int getTime()
      Method to get the time
      Returns:
      the race time