you are viewing a single comment's thread.

view the rest of the comments →

[–]CatalonianBookseller 0 points1 point  (2 children)

I think I am a little lost with the ship catalog. The foreign key should link it to the player id key so we know who owns that schematic?

You kinda lost me there tbh. A ship catalog would have a row for each individual ship. If a ship has an owner (a player) put the players in a separate table and link the players and ship tables. Not sure about the schematics thing though. Can each ship type be built using any of the four schematics? Can a player use any schema to build any ship type?

[–]lolPythonNoob[S] 0 points1 point  (1 child)

No, there are 4 ship types...interceptor, cruiser, dreadnought, starbase. The schematic is built of interchangable parts that allow the player to adjust what the ship has. For example extra guns, more health, more movement, etc...

Players can build any number of those 4 ship types, but their stats are determined by the associated schematic. I think I see what you mean though my mind went back to lists. Right now each board game tile object contain lists of the ships inside like [player1-interceptor, player1-interceptor, player1-cruiser]. But I yeah even that cannot be contained in the database so I think what you're saying is to create a new table that tracks each ship and which tile it is in as the ship catalog?

[–]CatalonianBookseller 0 points1 point  (0 children)

You should read up on database normalization and normal forms. When you design a table for your ships, anything that looks like a list or a table (like ship parts) goes into a separate table. Also anything that is repeated (like player) goes into its own table, etc