// 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 starship

func Find(id string) *Starship {
	for _, v := range starships {
		if v.StarshipID == id {
			other := v
			return &other
		}
	}
	return nil
}

type Starship struct {
	StarshipID           string
	Name                 string
	Model                string
	Manufacturer         string
	CostInCredits        uint64
	Length               uint64
	MaxAtmospheringSpeed uint64
	Crew                 uint64
	Passengers           uint64
	CargoCapacity        uint64
	Consumables          string
	HyperdriveRating     float64
	MGLT                 uint64
	StarshipClass        string
	// Relationships
	PilotIDs []string
	FilmIDs  []string
}

var starships = []Starship{
	{
		StarshipID:           "2",
		Name:                 "CR90 corvette",
		Model:                "CR90 corvette",
		Manufacturer:         "Corellian Engineering Corporation",
		CostInCredits:        3500000,
		Length:               150,
		MaxAtmospheringSpeed: 950,
		Crew:                 30,
		Passengers:           600,
		CargoCapacity:        3000000,
		Consumables:          "1 year",
		HyperdriveRating:     2,
		MGLT:                 60,
		StarshipClass:        "corvette",
		FilmIDs:              []string{"1", "3", "6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "3",
		Name:                 "Star Destroyer",
		Model:                "Imperial I-class Star Destroyer",
		Manufacturer:         "Kuat Drive Yards",
		CostInCredits:        150000000,
		Length:               1600,
		MaxAtmospheringSpeed: 975,
		Crew:                 47060,
		Passengers:           0,
		CargoCapacity:        36000000,
		Consumables:          "2 years",
		HyperdriveRating:     2,
		MGLT:                 60,
		StarshipClass:        "Star Destroyer",
		FilmIDs:              []string{"1", "2", "3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "5",
		Name:                 "Sentinel-class landing craft",
		Model:                "Sentinel-class landing craft",
		Manufacturer:         "Sienar Fleet Systems, Cyngus Spaceworks",
		CostInCredits:        240000,
		Length:               38,
		MaxAtmospheringSpeed: 1000,
		Crew:                 5,
		Passengers:           75,
		CargoCapacity:        180000,
		Consumables:          "1 month",
		HyperdriveRating:     1,
		MGLT:                 70,
		StarshipClass:        "landing craft",
		FilmIDs:              []string{"1"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "9",
		Name:                 "Death Star",
		Model:                "DS-1 Orbital Battle Station",
		Manufacturer:         "Imperial Department of Military Research, Sienar Fleet Systems",
		CostInCredits:        1000000000000,
		Length:               120000,
		MaxAtmospheringSpeed: 0,
		Crew:                 342953,
		Passengers:           843342,
		CargoCapacity:        1000000000000,
		Consumables:          "3 years",
		HyperdriveRating:     4,
		MGLT:                 10,
		StarshipClass:        "Deep Space Mobile Battlestation",
		FilmIDs:              []string{"1"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "10",
		Name:                 "Millennium Falcon",
		Model:                "YT-1300 light freighter",
		Manufacturer:         "Corellian Engineering Corporation",
		CostInCredits:        100000,
		Length:               34,
		MaxAtmospheringSpeed: 1050,
		Crew:                 4,
		Passengers:           6,
		CargoCapacity:        100000,
		Consumables:          "2 months",
		HyperdriveRating:     0.5,
		MGLT:                 75,
		StarshipClass:        "Light freighter",
		FilmIDs:              []string{"1", "2", "3"},
		PilotIDs:             []string{"13", "14", "25", "31"},
	},
	{
		StarshipID:           "11",
		Name:                 "Y-wing",
		Model:                "BTL Y-wing",
		Manufacturer:         "Koensayr Manufacturing",
		CostInCredits:        134999,
		Length:               14,
		MaxAtmospheringSpeed: 1000,
		Crew:                 2,
		Passengers:           0,
		CargoCapacity:        110,
		Consumables:          "1 week",
		HyperdriveRating:     1,
		MGLT:                 80,
		StarshipClass:        "assault starfighter",
		FilmIDs:              []string{"1", "2", "3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "12",
		Name:                 "X-wing",
		Model:                "T-65 X-wing",
		Manufacturer:         "Incom Corporation",
		CostInCredits:        149999,
		Length:               12,
		MaxAtmospheringSpeed: 1050,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        110,
		Consumables:          "1 week",
		HyperdriveRating:     1,
		MGLT:                 100,
		StarshipClass:        "Starfighter",
		FilmIDs:              []string{"1", "2", "3"},
		PilotIDs:             []string{"1", "9", "18", "19"},
	},
	{
		StarshipID:           "13",
		Name:                 "TIE Advanced x1",
		Model:                "Twin Ion Engine Advanced x1",
		Manufacturer:         "Sienar Fleet Systems",
		CostInCredits:        0,
		Length:               9,
		MaxAtmospheringSpeed: 1200,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        150,
		Consumables:          "5 days",
		HyperdriveRating:     1,
		MGLT:                 105,
		StarshipClass:        "Starfighter",
		FilmIDs:              []string{"1"},
		PilotIDs:             []string{"4"},
	},
	{
		StarshipID:           "15",
		Name:                 "Executor",
		Model:                "Executor-class star dreadnought",
		Manufacturer:         "Kuat Drive Yards, Fondor Shipyards",
		CostInCredits:        1143350000,
		Length:               19000,
		MaxAtmospheringSpeed: 0,
		Crew:                 279144,
		Passengers:           38000,
		CargoCapacity:        250000000,
		Consumables:          "6 years",
		HyperdriveRating:     2,
		MGLT:                 40,
		StarshipClass:        "Star dreadnought",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "17",
		Name:                 "Rebel transport",
		Model:                "GR-75 medium transport",
		Manufacturer:         "Gallofree Yards, Inc.",
		CostInCredits:        0,
		Length:               90,
		MaxAtmospheringSpeed: 650,
		Crew:                 6,
		Passengers:           90,
		CargoCapacity:        19000000,
		Consumables:          "6 months",
		HyperdriveRating:     4,
		MGLT:                 20,
		StarshipClass:        "Medium transport",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "21",
		Name:                 "Slave 1",
		Model:                "Firespray-31-class patrol and attack",
		Manufacturer:         "Kuat Systems Engineering",
		CostInCredits:        0,
		Length:               21,
		MaxAtmospheringSpeed: 1000,
		Crew:                 1,
		Passengers:           6,
		CargoCapacity:        70000,
		Consumables:          "1 month",
		HyperdriveRating:     3,
		MGLT:                 70,
		StarshipClass:        "Patrol craft",
		FilmIDs:              []string{"2", "5"},
		PilotIDs:             []string{"22"},
	},
	{
		StarshipID:           "22",
		Name:                 "Imperial shuttle",
		Model:                "Lambda-class T-4a shuttle",
		Manufacturer:         "Sienar Fleet Systems",
		CostInCredits:        240000,
		Length:               20,
		MaxAtmospheringSpeed: 850,
		Crew:                 6,
		Passengers:           20,
		CargoCapacity:        80000,
		Consumables:          "2 months",
		HyperdriveRating:     1,
		MGLT:                 50,
		StarshipClass:        "Armed government transport",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{"1", "13", "14"},
	},
	{
		StarshipID:           "23",
		Name:                 "EF76 Nebulon-B escort frigate",
		Model:                "EF76 Nebulon-B escort frigate",
		Manufacturer:         "Kuat Drive Yards",
		CostInCredits:        8500000,
		Length:               300,
		MaxAtmospheringSpeed: 800,
		Crew:                 854,
		Passengers:           75,
		CargoCapacity:        6000000,
		Consumables:          "2 years",
		HyperdriveRating:     2,
		MGLT:                 40,
		StarshipClass:        "Escort ship",
		FilmIDs:              []string{"2", "3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "27",
		Name:                 "Calamari Cruiser",
		Model:                "MC80 Liberty type Star Cruiser",
		Manufacturer:         "Mon Calamari shipyards",
		CostInCredits:        104000000,
		Length:               1200,
		MaxAtmospheringSpeed: 0,
		Crew:                 5400,
		Passengers:           1200,
		CargoCapacity:        0,
		Consumables:          "2 years",
		HyperdriveRating:     1,
		MGLT:                 60,
		StarshipClass:        "Star Cruiser",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "28",
		Name:                 "A-wing",
		Model:                "RZ-1 A-wing Interceptor",
		Manufacturer:         "Alliance Underground Engineering, Incom Corporation",
		CostInCredits:        175000,
		Length:               9,
		MaxAtmospheringSpeed: 1300,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        40,
		Consumables:          "1 week",
		HyperdriveRating:     1,
		MGLT:                 120,
		StarshipClass:        "Starfighter",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{"29"},
	},
	{
		StarshipID:           "29",
		Name:                 "B-wing",
		Model:                "A/SF-01 B-wing starfighter",
		Manufacturer:         "Slayn & Korpil",
		CostInCredits:        220000,
		Length:               16,
		MaxAtmospheringSpeed: 950,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        45,
		Consumables:          "1 week",
		HyperdriveRating:     2,
		MGLT:                 91,
		StarshipClass:        "Assault Starfighter",
		FilmIDs:              []string{"3"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "31",
		Name:                 "Republic Cruiser",
		Model:                "Consular-class cruiser",
		Manufacturer:         "Corellian Engineering Corporation",
		CostInCredits:        0,
		Length:               115,
		MaxAtmospheringSpeed: 900,
		Crew:                 9,
		Passengers:           16,
		CargoCapacity:        0,
		Consumables:          "unknown",
		HyperdriveRating:     2,
		MGLT:                 0,
		StarshipClass:        "Space cruiser",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "32",
		Name:                 "Droid control ship",
		Model:                "Lucrehulk-class Droid Control Ship",
		Manufacturer:         "Hoersch-Kessel Drive, Inc.",
		CostInCredits:        0,
		Length:               3170,
		MaxAtmospheringSpeed: 0,
		Crew:                 175,
		Passengers:           139000,
		CargoCapacity:        4000000000,
		Consumables:          "500 days",
		HyperdriveRating:     2,
		MGLT:                 0,
		StarshipClass:        "Droid control ship",
		FilmIDs:              []string{"4", "5", "6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "39",
		Name:                 "Naboo fighter",
		Model:                "N-1 starfighter",
		Manufacturer:         "Theed Palace Space Vessel Engineering Corps",
		CostInCredits:        200000,
		Length:               11,
		MaxAtmospheringSpeed: 1100,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        65,
		Consumables:          "7 days",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "Starfighter",
		FilmIDs:              []string{"4", "5"},
		PilotIDs:             []string{"11", "35", "60"},
	},
	{
		StarshipID:           "40",
		Name:                 "Naboo Royal Starship",
		Model:                "J-type 327 Nubian royal starship",
		Manufacturer:         "Theed Palace Space Vessel Engineering Corps, Nubia Star Drives",
		CostInCredits:        0,
		Length:               76,
		MaxAtmospheringSpeed: 920,
		Crew:                 8,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "unknown",
		HyperdriveRating:     1.8,
		MGLT:                 0,
		StarshipClass:        "yacht",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{"39"},
	},
	{
		StarshipID:           "41",
		Name:                 "Scimitar",
		Model:                "Star Courier",
		Manufacturer:         "Republic Sienar Systems",
		CostInCredits:        55000000,
		Length:               26,
		MaxAtmospheringSpeed: 1180,
		Crew:                 1,
		Passengers:           6,
		CargoCapacity:        2500000,
		Consumables:          "30 days",
		HyperdriveRating:     1.5,
		MGLT:                 0,
		StarshipClass:        "Space Transport",
		FilmIDs:              []string{"4"},
		PilotIDs:             []string{"44"},
	},
	{
		StarshipID:           "43",
		Name:                 "J-type diplomatic barge",
		Model:                "J-type diplomatic barge",
		Manufacturer:         "Theed Palace Space Vessel Engineering Corps, Nubia Star Drives",
		CostInCredits:        2000000,
		Length:               39,
		MaxAtmospheringSpeed: 2000,
		Crew:                 5,
		Passengers:           10,
		CargoCapacity:        0,
		Consumables:          "1 year",
		HyperdriveRating:     0.7,
		MGLT:                 0,
		StarshipClass:        "Diplomatic barge",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "47",
		Name:                 "AA-9 Coruscant freighter",
		Model:                "Botajef AA-9 Freighter-Liner",
		Manufacturer:         "Botajef Shipyards",
		CostInCredits:        0,
		Length:               390,
		MaxAtmospheringSpeed: 0,
		Crew:                 0,
		Passengers:           30000,
		CargoCapacity:        0,
		Consumables:          "unknown",
		HyperdriveRating:     0,
		MGLT:                 0,
		StarshipClass:        "freighter",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "48",
		Name:                 "Jedi starfighter",
		Model:                "Delta-7 Aethersprite-class interceptor",
		Manufacturer:         "Kuat Systems Engineering",
		CostInCredits:        180000,
		Length:               8,
		MaxAtmospheringSpeed: 1150,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        60,
		Consumables:          "7 days",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "Starfighter",
		FilmIDs:              []string{"5", "6"},
		PilotIDs:             []string{"10", "58"},
	},
	{
		StarshipID:           "49",
		Name:                 "H-type Nubian yacht",
		Model:                "H-type Nubian yacht",
		Manufacturer:         "Theed Palace Space Vessel Engineering Corps",
		CostInCredits:        0,
		Length:               47,
		MaxAtmospheringSpeed: 8000,
		Crew:                 4,
		Passengers:           0,
		CargoCapacity:        0,
		Consumables:          "unknown",
		HyperdriveRating:     0.9,
		MGLT:                 0,
		StarshipClass:        "yacht",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{"35"},
	},
	{
		StarshipID:           "52",
		Name:                 "Republic Assault ship",
		Model:                "Acclamator I-class assault ship",
		Manufacturer:         "Rothana Heavy Engineering",
		CostInCredits:        0,
		Length:               752,
		MaxAtmospheringSpeed: 0,
		Crew:                 700,
		Passengers:           16000,
		CargoCapacity:        11250000,
		Consumables:          "2 years",
		HyperdriveRating:     0.6,
		MGLT:                 0,
		StarshipClass:        "assault ship",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "58",
		Name:                 "Solar Sailer",
		Model:                "Punworcca 116-class interstellar sloop",
		Manufacturer:         "Huppla Pasa Tisc Shipwrights Collective",
		CostInCredits:        35700,
		Length:               15,
		MaxAtmospheringSpeed: 1600,
		Crew:                 3,
		Passengers:           11,
		CargoCapacity:        240,
		Consumables:          "7 days",
		HyperdriveRating:     1.5,
		MGLT:                 0,
		StarshipClass:        "yacht",
		FilmIDs:              []string{"5"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "59",
		Name:                 "Trade Federation cruiser",
		Model:                "Providence-class carrier/destroyer",
		Manufacturer:         "Rendili StarDrive, Free Dac Volunteers Engineering corps.",
		CostInCredits:        125000000,
		Length:               1088,
		MaxAtmospheringSpeed: 1050,
		Crew:                 600,
		Passengers:           48247,
		CargoCapacity:        50000000,
		Consumables:          "4 years",
		HyperdriveRating:     1.5,
		MGLT:                 0,
		StarshipClass:        "capital ship",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{"10", "11"},
	},
	{
		StarshipID:           "61",
		Name:                 "Theta-class T-2c shuttle",
		Model:                "Theta-class T-2c shuttle",
		Manufacturer:         "Cygnus Spaceworks",
		CostInCredits:        1000000,
		Length:               18,
		MaxAtmospheringSpeed: 2000,
		Crew:                 5,
		Passengers:           16,
		CargoCapacity:        50000,
		Consumables:          "56 days",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "transport",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "63",
		Name:                 "Republic attack cruiser",
		Model:                "Senator-class Star Destroyer",
		Manufacturer:         "Kuat Drive Yards, Allanteen Six shipyards",
		CostInCredits:        59000000,
		Length:               1137,
		MaxAtmospheringSpeed: 975,
		Crew:                 7400,
		Passengers:           2000,
		CargoCapacity:        20000000,
		Consumables:          "2 years",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "star destroyer",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "64",
		Name:                 "Naboo star skiff",
		Model:                "J-type star skiff",
		Manufacturer:         "Theed Palace Space Vessel Engineering Corps/Nubia Star Drives, Incorporated",
		CostInCredits:        0,
		Length:               29,
		MaxAtmospheringSpeed: 1050,
		Crew:                 3,
		Passengers:           3,
		CargoCapacity:        0,
		Consumables:          "unknown",
		HyperdriveRating:     0.5,
		MGLT:                 0,
		StarshipClass:        "yacht",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{"10", "35"},
	},
	{
		StarshipID:           "65",
		Name:                 "Jedi Interceptor",
		Model:                "Eta-2 Actis-class light interceptor",
		Manufacturer:         "Kuat Systems Engineering",
		CostInCredits:        320000,
		Length:               5,
		MaxAtmospheringSpeed: 1500,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        60,
		Consumables:          "2 days",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "starfighter",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{"10", "11"},
	},
	{
		StarshipID:           "66",
		Name:                 "arc-170",
		Model:                "Aggressive Reconnaissance-170 starfighte",
		Manufacturer:         "Incom Corporation, Subpro Corporation",
		CostInCredits:        155000,
		Length:               14,
		MaxAtmospheringSpeed: 1000,
		Crew:                 3,
		Passengers:           0,
		CargoCapacity:        110,
		Consumables:          "5 days",
		HyperdriveRating:     1,
		MGLT:                 100,
		StarshipClass:        "starfighter",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "68",
		Name:                 "Banking clan frigte",
		Model:                "Munificent-class star frigate",
		Manufacturer:         "Hoersch-Kessel Drive, Inc, Gwori Revolutionary Industries",
		CostInCredits:        57000000,
		Length:               825,
		MaxAtmospheringSpeed: 0,
		Crew:                 200,
		Passengers:           0,
		CargoCapacity:        40000000,
		Consumables:          "2 years",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "cruiser",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
	{
		StarshipID:           "74",
		Name:                 "Belbullab-22 starfighter",
		Model:                "Belbullab-22 starfighter",
		Manufacturer:         "Feethan Ottraw Scalable Assemblies",
		CostInCredits:        168000,
		Length:               6,
		MaxAtmospheringSpeed: 1100,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        140,
		Consumables:          "7 days",
		HyperdriveRating:     6,
		MGLT:                 0,
		StarshipClass:        "starfighter",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{"10", "79"},
	},
	{
		StarshipID:           "75",
		Name:                 "V-wing",
		Model:                "Alpha-3 Nimbus-class V-wing starfighter",
		Manufacturer:         "Kuat Systems Engineering",
		CostInCredits:        102500,
		Length:               7,
		MaxAtmospheringSpeed: 1050,
		Crew:                 1,
		Passengers:           0,
		CargoCapacity:        60,
		Consumables:          "15 hours",
		HyperdriveRating:     1,
		MGLT:                 0,
		StarshipClass:        "starfighter",
		FilmIDs:              []string{"6"},
		PilotIDs:             []string{},
	},
}
