From c432d3c6a763dc7e83cc92a803eb7a14350b2d01 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Mon, 15 Apr 2024 19:56:43 -0700 Subject: [PATCH] Minor cleanup. --- README.md | 15 +++++++++++++++ data.py | 14 +++++++++++++- game.sqlite | Bin 389120 -> 389120 bytes population.py | 6 +++--- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index efbfb44..07c257d 100644 --- a/README.md +++ b/README.md @@ -250,3 +250,18 @@ It would be fun to see if the Treeview widget could handle all the stars and planets... 12,300 planets, 1,948 stars, it should be able to handle it? + +Mon Apr 15 15:48:51 PDT 2024 + +Pop growth on homeworlds only: we want the populations that are on a +planet where that planet is in the home stellar system of the species of +the population. + +planets.star = populations.homestar + +What if in the populations table instead of the species column there is a +home system column? We can get the species name from the homestar name +as needed? + +Is there a good reason not to have the species name with the pops? Extra +space used I guess, maybe? pop.homestar.name + 'ians' diff --git a/data.py b/data.py index aefc348..5f7e171 100644 --- a/data.py +++ b/data.py @@ -62,10 +62,22 @@ TABLES = [ species TEXT, pop INTEGER, planet INTEGER, + vessel INTEGER, + station INTEGER, FOREIGN KEY(planet) REFERENCES planets(id) - )''', + check ( + ( case when planet is null then 0 else 1 end + + case when vessel is null then 0 else 1 end + + case when station is null then 0 else 1 end + ) = 1 + ) + ) + ''', ] +# Apparently this clause should constrain a pop to be +# in only one location at a time. + def initialize_db_tables(filename): conn = open_db(filename) diff --git a/game.sqlite b/game.sqlite index 85b246defc0ff04c2fc35227356be4b7a8476d10..baf6bb04d9f62d59be15ad2646a2345bde2c3543 100644 GIT binary patch delta 749 zcmb7>F>KR76o$`^lWUyB7bK`j6Vj_P5EH64LV$$mLKOk3R7xp(F7_#Lx!94<4(fnX zS_A_Fm5zm}2qs3#fW%Mj(P!fxbnL zp`Rd`*$3!2`lNlxZDsaf-@lzvH?Jh2Ua3eA7X(H{DJ3qWr;~lkIc50z;!5LcWBII# zM~C~ww_QivzW4w*D-ahNKpGr zFq-xsiqOa6(8xa|2A;!p)rbZf8#4;ji$&?dd7rcxja~B5lN2AbpM}UZb@*yvn=vo#OpHNL8|s&7*xCzt z;P9A@-#Y;zn34w}yhd2~RdHU;;?&6AO2>7W-3hvG+jCvh_2P=@FXKrFDv>Ln_T07` z=jCci8LkpGoOk<_1s)ID#Is_0aw#XV~b}d@;%wa)>z=*UR+a%1i l=xE8pvr`fT^&t{JCMPzP<|Cykg&~KL2t#?RG?Txc`~kj0*PH+V delta 570 zcmYL^J!lj`7=~wOXYOLMH?tDW=6*PpBbZA}VhCz0rU_Um(N?^<-Enu1y`5!$f>(r` zIl)q81hEsW(kLY0fmo)pNvU=L8?g|zPT_ca;J`cIFwgh%e*I&se{4PDr^!cvjXgkT z$YJRVd2Z|-teR^^efJVBTGgudcqL`+fJXrfd76wvLB1^=$v(MJd304TT9&2l-W;VR zDT|ZQh2%1Qts!|t=ch0LU_uGphVqa!HC_HB7w259Xf+zz;A}oXL|MR6UxZ2Y{|V*q zsTcCSu{d{Lon}e(Fvt+lZ}by=MEUY0)s^eH+Q(|8fQrsCOMkfo-Sf=0m2Oyq#n;dCyja`x9N#6 z@V%@n+*k-(#5rI3dIn?AP+n3V33qHB&R5Vs^Ke~k@gR$n%w@5YSIl~o8g