# StorageVehicle
Date: 2020-04-18

me.legofreak107.vehiclesplus.vehicles.vehicles.objects

## Class StorageVehicle

- java.lang.Object
- - me.legofreak107.vehiclesplus.vehicles.vehicles.objects.StorageVehicle

    public class StorageVehicle
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`StorageVehicle(BaseVehicle baseVehicle, java.lang.String playerUid)` Constructor to define a new StorageVehicle

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`java.util.List<java.lang.String>` `getInfoList()` Get a list of vehicle information, perfect for lores of items
`static StorageVehicle` `loadFromStorage(java.lang.String file)` Load a vehicle from storage file
`void` `removeVehicle(org.bukkit.entity.Player owner)` Delete this vehicle from storage.
`void` `saveVehicle()` Update this vehicles data to file system
`void` `setNewOwner(org.bukkit.entity.Player oldOwner, org.bukkit.entity.Player newOwner)` Change vehicle ownership
`SpawnedVehicle` `spawnVehicle(org.bukkit.Location loc, SpawnMode spawnMode)` Spawn this vehicle

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StorageVehicle

    public StorageVehicle(BaseVehicle baseVehicle,
                          @Nullable
                          java.lang.String playerUid)

Constructor to define a new StorageVehicle

Parameters:
  `baseVehicle` - the base type of vehicle
  `playerUid` - the owning player

### Method Detail

#### spawnVehicle

    public SpawnedVehicle spawnVehicle(org.bukkit.Location loc,
                                       SpawnMode spawnMode)

Spawn this vehicle

Parameters:
  `loc` - location to spawn at
Returns:
  SpawnedVehicle

#### saveVehicle

    public void saveVehicle()

Update this vehicles data to file system

#### setNewOwner

    public void setNewOwner(org.bukkit.entity.Player oldOwner,
                            org.bukkit.entity.Player newOwner)

Change vehicle ownership

Parameters:
  `oldOwner` - the old owner
  `newOwner` - the new owner

#### removeVehicle

    public void removeVehicle(org.bukkit.entity.Player owner)

Delete this vehicle from storage.

Parameters:
  `owner` - owning player

#### loadFromStorage

    public static StorageVehicle loadFromStorage(java.lang.String file)

Load a vehicle from storage file

Parameters:
  `file` - path of the yml file containing vehicle data
Returns:
  StorageVehicle

#### getInfoList

    public java.util.List<java.lang.String> getInfoList()

Get a list of vehicle information, perfect for lores of items

Returns:
  String list with info