// Copyright 2023 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package vehicle

func Find(id string) *Vehicle {
	for _, v := range vehicles {
		if v.VehicleID == id {
			other := v
			return &other
		}
	}
	return nil
}

type Vehicle struct {
	VehicleID            string
	Name                 string
	Model                string
	Manufacturer         string
	CostInCredits        uint64
	Length               float64
	MaxAtmospheringSpeed uint64
	Crew                 uint64
	Passengers           uint64
	CargoCapacity        uint64
	Consumables          string
	VehicleClass         string
	// Relations
	PilotIDs []string
	FilmIDs  []string
}

var vehicles = []Vehicle{
	{
		VehicleID:            "4",
		Name:                 "Sand Crawler",
		Model:                "Digger Crawler",
		Manufacturer:         "Corellia Mining Corporation",
		CostInCredits:        150000,
		Length:               36.8,
		MaxAtmospheringSpeed: 30,
		Crew:                 46,
		Passengers:           30,
		CargoCapacity:        50000,
		Consumables:          "2 months",
		VehicleClass:         "wheeled",
		FilmIDs:              []string{"1", "5"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "6",
		Name:                 "T-16 skyhopper",
		Model:                "T-16 skyhopper",
		Manufacturer:         "Incom Corporation",
		CostInCredits:        14500,
		Length:               10.4,
		MaxAtmospheringSpeed: 1200,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        50,
		Consumables:          "0",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"1"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "7",
		Name:                 "X-34 landspeeder",
		Model:                "X-34 landspeeder",
		Manufacturer:         "SoroSuub Corporation",
		CostInCredits:        10550,
		Length:               3.4,
		MaxAtmospheringSpeed: 250,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        5,
		Consumables:          "unknown",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"1"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "8",
		Name:                 "TIE/LN starfighter",
		Model:                "Twin Ion Engine/Ln Starfighter",
		Manufacturer:         "Sienar Fleet Systems",
		CostInCredits:        0,
		Length:               6.4,
		MaxAtmospheringSpeed: 1200,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        65,
		Consumables:          "2 days",
		VehicleClass:         "starfighter",
		FilmIDs:              []string{"1", "2", "3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "14",
		Name:                 "Snowspeeder",
		Model:                "t-47 airspeeder",
		Manufacturer:         "Incom corporation",
		CostInCredits:        0,
		Length:               4.5,
		MaxAtmospheringSpeed: 650,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        10,
		Consumables:          "none",
		VehicleClass:         "airspeeder",
		FilmIDs:              []string{"2"},
		PilotIDs:             []string{"1", "18"},
	},
	{
		VehicleID:            "16",
		Name:                 "TIE bomber",
		Model:                "TIE/sa bomber",
		Manufacturer:         "Sienar Fleet Systems",
		CostInCredits:        0,
		Length:               7.8,
		MaxAtmospheringSpeed: 850,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "2 days",
		VehicleClass:         "space/planetary bomber",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "18",
		Name:                 "AT-AT",
		Model:                "All Terrain Armored Transport",
		Manufacturer:         "Kuat Drive Yards, Imperial Department of Military Research",
		CostInCredits:        0,
		Length:               20,
		MaxAtmospheringSpeed: 60,
		Crew:                 5,
		Passengers:           40,
		CargoCapacity:        1000,
		Consumables:          "unknown",
		VehicleClass:         "assault walker",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "19",
		Name:                 "AT-ST",
		Model:                "All Terrain Scout Transport",
		Manufacturer:         "Kuat Drive Yards, Imperial Department of Military Research",
		CostInCredits:        0,
		Length:               2,
		MaxAtmospheringSpeed: 90,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        200,
		Consumables:          "none",
		VehicleClass:         "walker",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{"13"},
	},
	{
		VehicleID:            "20",
		Name:                 "Storm IV Twin-Pod cloud car",
		Model:                "Storm IV Twin-Pod",
		Manufacturer:         "Bespin Motors",
		CostInCredits:        75000,
		Length:               7,
		MaxAtmospheringSpeed: 1500,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        10,
		Consumables:          "1 day",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"2"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "24",
		Name:                 "Sail barge",
		Model:                "Modified Luxury Sail Barge",
		Manufacturer:         "Ubrikkian Industries Custom Vehicle Division",
		CostInCredits:        285000,
		Length:               30,
		MaxAtmospheringSpeed: 100,
		Crew:                 26,
		Passengers:           500,
		CargoCapacity:        2000000,
		Consumables:          "Live food tanks",
		VehicleClass:         "sail barge",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "25",
		Name:                 "Bantha-II cargo skiff",
		Model:                "Bantha-II",
		Manufacturer:         "Ubrikkian Industries",
		CostInCredits:        8000,
		Length:               9.5,
		MaxAtmospheringSpeed: 250,
		Crew:                 5,
		Passengers:           16,
		CargoCapacity:        135000,
		Consumables:          "1 day",
		VehicleClass:         "repulsorcraft cargo skiff",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "26",
		Name:                 "TIE/IN interceptor",
		Model:                "Twin Ion Engine Interceptor",
		Manufacturer:         "Sienar Fleet Systems",
		CostInCredits:        0,
		Length:               9.6,
		MaxAtmospheringSpeed: 1250,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        75,
		Consumables:          "2 days",
		VehicleClass:         "starfighter",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "30",
		Name:                 "Imperial Speeder Bike",
		Model:                "74-Z speeder bike",
		Manufacturer:         "Aratech Repulsor Company",
		CostInCredits:        8000,
		Length:               3,
		MaxAtmospheringSpeed: 360,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        4,
		Consumables:          "1 day",
		VehicleClass:         "speeder",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{"1", "5"},
	},
	{
		VehicleID:            "33",
		Name:                 "Vulture Droid",
		Model:                "Vulture-class droid starfighter",
		Manufacturer:         "Haor Chall Engineering, Baktoid Armor Workshop",
		CostInCredits:        0,
		Length:               3.5,
		MaxAtmospheringSpeed: 1200,
		Crew:                 0,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "none",
		VehicleClass:         "starfighter",
		FilmIDs:              []string{"4", "6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "34",
		Name:                 "Multi-Troop Transport",
		Model:                "Multi-Troop Transport",
		Manufacturer:         "Baktoid Armor Workshop",
		CostInCredits:        138000,
		Length:               31,
		MaxAtmospheringSpeed: 35,
		Crew:                 4,
		Passengers:           112,
		CargoCapacity:        12000,
		Consumables:          "unknown",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "35",
		Name:                 "Armored Assault Tank",
		Model:                "Armoured Assault Tank",
		Manufacturer:         "Baktoid Armor Workshop",
		CostInCredits:        0,
		Length:               9.75,
		MaxAtmospheringSpeed: 55,
		Crew:                 4,
		Passengers:           6,
		CargoCapacity:        0,
		Consumables:          "unknown",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "36",
		Name:                 "Single Trooper Aerial Platform",
		Model:                "Single Trooper Aerial Platform",
		Manufacturer:         "Baktoid Armor Workshop",
		CostInCredits:        2500,
		Length:               2,
		MaxAtmospheringSpeed: 400,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "none",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "37",
		Name:                 "C-9979 landing craft",
		Model:                "C-9979 landing craft",
		Manufacturer:         "Haor Chall Engineering",
		CostInCredits:        200000,
		Length:               210,
		MaxAtmospheringSpeed: 587,
		Crew:                 140,
		Passengers:           284,
		CargoCapacity:        1800000,
		Consumables:          "1 day",
		VehicleClass:         "landing craft",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "38",
		Name:                 "Tribubble bongo",
		Model:                "Tribubble bongo",
		Manufacturer:         "Otoh Gunga Bongameken Cooperative",
		CostInCredits:        0,
		Length:               15,
		MaxAtmospheringSpeed: 85,
		Crew:                 1,
		Passengers:           2,
		CargoCapacity:        1600,
		Consumables:          "unknown",
		VehicleClass:         "submarine",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{"10", "32"},
	},
	{
		VehicleID:            "42",
		Name:                 "Sith speeder",
		Model:                "FC-20 speeder bike",
		Manufacturer:         "Razalon",
		CostInCredits:        4000,
		Length:               1.5,
		MaxAtmospheringSpeed: 180,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        2,
		Consumables:          "unknown",
		VehicleClass:         "speeder",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{"44"},
	},
	{
		VehicleID:            "44",
		Name:                 "Zephyr-G swoop bike",
		Model:                "Zephyr-G swoop bike",
		Manufacturer:         "Mobquet Swoops and Speeders",
		CostInCredits:        5750,
		Length:               3.68,
		MaxAtmospheringSpeed: 350,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        200,
		Consumables:          "none",
		VehicleClass:         "repulsorcraft",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{"11"},
	},
	{
		VehicleID:            "45",
		Name:                 "Koro-2 Exodrive airspeeder",
		Model:                "Koro-2 Exodrive airspeeder",
		Manufacturer:         "Desler Gizh Outworld Mobility Corporation",
		CostInCredits:        0,
		Length:               6.6,
		MaxAtmospheringSpeed: 800,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        80,
		Consumables:          "unknown",
		VehicleClass:         "airspeeder",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{"70"},
	},
	{
		VehicleID:            "46",
		Name:                 "XJ-6 airspeeder",
		Model:                "XJ-6 airspeeder",
		Manufacturer:         "Narglatch AirTech prefabricated kit",
		CostInCredits:        0,
		Length:               6.23,
		MaxAtmospheringSpeed: 720,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        0,
		Consumables:          "unknown",
		VehicleClass:         "airspeeder",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{"11"},
	},
	{
		VehicleID:            "50",
		Name:                 "LAAT/i",
		Model:                "Low Altitude Assault Transport/infrantry",
		Manufacturer:         "Rothana Heavy Engineering",
		CostInCredits:        0,
		Length:               17.4,
		MaxAtmospheringSpeed: 620,
		Crew:                 6,
		Passengers:           30,
		CargoCapacity:        170,
		Consumables:          "unknown",
		VehicleClass:         "gunship",
		FilmIDs:              []string{"5", "6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "51",
		Name:                 "LAAT/c",
		Model:                "Low Altitude Assault Transport/carrier",
		Manufacturer:         "Rothana Heavy Engineering",
		CostInCredits:        0,
		Length:               28.82,
		MaxAtmospheringSpeed: 620,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        40000,
		Consumables:          "unknown",
		VehicleClass:         "gunship",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "53",
		Name:                 "AT-TE",
		Model:                "All Terrain Tactical Enforcer",
		Manufacturer:         "Rothana Heavy Engineering, Kuat Drive Yards",
		CostInCredits:        0,
		Length:               13.2,
		MaxAtmospheringSpeed: 60,
		Crew:                 6,
		Passengers:           36,
		CargoCapacity:        10000,
		Consumables:          "21 days",
		VehicleClass:         "walker",
		FilmIDs:              []string{"5", "6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "54",
		Name:                 "SPHA",
		Model:                "Self-Propelled Heavy Artillery",
		Manufacturer:         "Rothana Heavy Engineering",
		CostInCredits:        0,
		Length:               140,
		MaxAtmospheringSpeed: 35,
		Crew:                 25,
		Passengers:           30,
		CargoCapacity:        500,
		Consumables:          "7 days",
		VehicleClass:         "walker",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "55",
		Name:                 "Flitknot speeder",
		Model:                "Flitknot speeder",
		Manufacturer:         "Huppla Pasa Tisc Shipwrights Collective",
		CostInCredits:        8000,
		Length:               2,
		MaxAtmospheringSpeed: 634,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "unknown",
		VehicleClass:         "speeder",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{"67"},
	},
	{
		VehicleID:            "56",
		Name:                 "Neimoidian shuttle",
		Model:                "Sheathipede-class transport shuttle",
		Manufacturer:         "Haor Chall Engineering",
		CostInCredits:        0,
		Length:               20,
		MaxAtmospheringSpeed: 880,
		Crew:                 2,
		Passengers:           6,
		CargoCapacity:        1000,
		Consumables:          "7 days",
		VehicleClass:         "transport",
		FilmIDs:              []string{"5", "6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "57",
		Name:                 "Geonosian starfighter",
		Model:                "Nantex-class territorial defense",
		Manufacturer:         "Huppla Pasa Tisc Shipwrights Collective",
		CostInCredits:        0,
		Length:               9.8,
		MaxAtmospheringSpeed: 20000,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "unknown",
		VehicleClass:         "starfighter",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "60",
		Name:                 "Tsmeu-6 personal wheel bike",
		Model:                "Tsmeu-6 personal wheel bike",
		Manufacturer:         "Z-Gomot Ternbuell Guppat Corporation",
		CostInCredits:        15000,
		Length:               3.5,
		MaxAtmospheringSpeed: 330,
		Crew:                 1,
		Passengers:           1,
		CargoCapacity:        10,
		Consumables:          "none",
		VehicleClass:         "wheeled walker",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{"79"},
	},
	{
		VehicleID:            "62",
		Name:                 "Emergency Firespeeder",
		Model:                "Fire suppression speeder",
		Manufacturer:         "unknown",
		CostInCredits:        0,
		Length:               0,
		MaxAtmospheringSpeed: 0,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "unknown",
		VehicleClass:         "fire suppression ship",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "67",
		Name:                 "Droid tri-fighter",
		Model:                "tri-fighter",
		Manufacturer:         "Colla Designs, Phlac-Arphocc Automata Industries",
		CostInCredits:        20000,
		Length:               5.4,
		MaxAtmospheringSpeed: 1180,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "none",
		VehicleClass:         "droid starfighter",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "69",
		Name:                 "Oevvaor jet catamaran",
		Model:                "Oevvaor jet catamaran",
		Manufacturer:         "Appazanna Engineering Works",
		CostInCredits:        12125,
		Length:               15.1,
		MaxAtmospheringSpeed: 420,
		Crew:                 2,
		Passengers:           2,
		CargoCapacity:        50,
		Consumables:          "3 days",
		VehicleClass:         "airspeeder",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "70",
		Name:                 "Raddaugh Gnasp fluttercraft",
		Model:                "Raddaugh Gnasp fluttercraft",
		Manufacturer:         "Appazanna Engineering Works",
		CostInCredits:        14750,
		Length:               7,
		MaxAtmospheringSpeed: 310,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        20,
		Consumables:          "none",
		VehicleClass:         "air speeder",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "71",
		Name:                 "Clone turbo tank",
		Model:                "HAVw A6 Juggernaut",
		Manufacturer:         "Kuat Drive Yards",
		CostInCredits:        350000,
		Length:               49.4,
		MaxAtmospheringSpeed: 160,
		Crew:                 20,
		Passengers:           300,
		CargoCapacity:        30000,
		Consumables:          "20 days",
		VehicleClass:         "wheeled walker",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "72",
		Name:                 "Corporate Alliance tank droid",
		Model:                "NR-N99 Persuader-class droid enforcer",
		Manufacturer:         "Techno Union",
		CostInCredits:        49000,
		Length:               10.96,
		MaxAtmospheringSpeed: 100,
		Crew:                 0,
		Passengers:           4,
		CargoCapacity:        0,
		Consumables:          "none",
		VehicleClass:         "droid tank",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "73",
		Name:                 "Droid gunship",
		Model:                "HMP droid gunship",
		Manufacturer:         "Baktoid Fleet Ordnance, Haor Chall Engineering",
		CostInCredits:        60000,
		Length:               12.3,
		MaxAtmospheringSpeed: 820,
		Crew:                 0,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "none",
		VehicleClass:         "airspeeder",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		VehicleID:            "76",
		Name:                 "AT-RT",
		Model:                "All Terrain Recon Transport",
		Manufacturer:         "Kuat Drive Yards",
		CostInCredits:        40000,
		Length:               3.2,
		MaxAtmospheringSpeed: 90,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        20,
		Consumables:          "1 day",
		VehicleClass:         "walker",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
}
