Thursday, March 15, 2018

Tracker - trade classifications

I have been depending on the TravellerMap API to have the trade code classifications in the Remarks field. While this does work, I'd rather have a more nuanced approach to have more details.

I already have the trade code table which gives you trade codes based on the UWP characteristics.  I've added a function to get that list of trade codes based on UWP. Had an issue with nulls but I'll update the DB to not allow nulls for the list of statistics, and that should correct it.

Since I am having to wipe my DB clean again (SQLite migrations do not support changing column attributes, the adding 'not nullable') I'll also expand out the seed that imports the trade codes to include all of them (I manually entered them for testing, found the null issue, and do not want to manually enter them all over again! Although a fix would be to initialize the new classification with blanks, I'd rather have the DB enforce that). This will still allow users to add their own trade codes if they want, and the T5 trade code generator will pick random goods based on trade codes, so that will allow for that to work. It won't affect Classic as that has a very restricted list.

The code to grab the list of trade classifications is pretty simple after the fact. What I've yet to figure out is how to add additional, non-UWP derived trade codes to a world (i.e., Capitol).  I'll probably add a new table for non-UWP trade classifications to allow for the manual entry, and combine those two lists in the new function.

 List results = App.DB.TradeClassifications.Where(x => x.Sizes.Length == 0 || x.Sizes.Contains(Size)).
                Where(x => x.Atmospheres.Length == 0 || x.Atmospheres.Contains(Atmosphere)).
                Where(x => x.Hydro.Length == 0 || x.Hydro.Contains(Hydro)).
                Where(x => x.Pop.Length == 0 || x.Pop.Contains(Population)).
                Where(x => x.Gov.Length == 0 || x.Gov.Contains(Gov)).
                Where(x =>x.Law.Length == 0 || x.Law.Contains(Law)).ToList();

Sunday, March 11, 2018

Tracker - T5 Trade, a start

I've started looking into the T5 trade rules. First step was to also have the list of possible trade goods, so there is yet another trade goods table. In hindsight, there should just be 1 but the Classic rules use s D66 method for rolling up the goods, and I did not want to have to figure out how to enforce that.

So I've grabbed a few cargoes from the BBB and stuck them in there. I may extend it out a bit more (i.e. include the full description of what it really is).  This will allow the users to add whatever cargoes they want to add that are trade class based. When I generate the T5 cargo, I'll randomly pick one of the trade codes, then randomly pick one of the trade goods for that trade code.

Down the road I would like a more personalized trade goods option - some of my world workups had some fairly detailed smaller cargoes. Sometimes it is that personal touch of having 50kg of specialized organic coffee versus a container of freeze dried caffeine.

It is going slower not due to being hard, but my severe lack of time :(

And while I thought about starting a PBP game, that severe lack of time keeps raising its head...

Saturday, March 03, 2018

Tracker - Printing...and maybe a PBP game on COTI?

Got the basic printing to work. I am not exactly happy with this - I create a rich text block and fill it up. To make things align I set the font to a fixed-width font.  I actually think I could do a hidden grid on the display page and use that - it would be automatic for the databinding and I could do some formatting...

I am also possibly going to start a PBP game over on COTI.  I've got some interest there from one of my fellow members, and I've got the inkling of a game idea based on some of his suggestions.  We'll see...if so, then hopefully this blog will be split between software and actual game stuff!

Thursday, March 01, 2018

Tracker - T5 rules

The T5 trade rules are just stubbed out. If your ship is Mongoose or T5, it just returns a message about not currently supported. There is a user over on COTI that wanted a T5 trade program.  I really did not like the T5 version as it seems so dry. It is not hard to do though, so I have a short road map:

1. Finish the cargo printing manifest (4-8 hours)
2. Do the T5 cargo (unknown duration as it has been a couple of years since I read over those rules)

Unfortunately school takes priority, and this is mid-term week. I need to write a paper about a project. Fortunately, I've actually just started a project for work, and that will become my mid-term paper (and won't work be surprised to get a project charter, stakeholder communication breakdown, and a process breakdown!)  As that needs to be completed by Sunday, and I really don't think it will be too difficult, I am hopefully that I'll complete the printing by this weekend (although I really want some sort of template system so that the user can format it a bit, but that will be version 2.0, and as I am on v0.0.0.1 at the moment...)

And I may move this tracker as a project once someone other than me is using it.  When that happens I may open up a Trello board for project management the Kanban style!

And how did March sneak up so fast?

Sunday, February 25, 2018

Tracker - Printing is still hard!

But I've got a start. Using some UWP Community tools to help with the print. What really needs to happen is a more generic way (there is a pretty good MVVM version that almost works, and might if I was doing the whole MVVM thing. But I am not).

I do have it printing the list control (the list of cargos themselves), but what really needs to happen is I need to create a nice looking RTF (Rich Text Format) and go from there. I now know how to get the print to work using the OS native print control, so there is a preview and all that. Now I just need to make a good-looking document and print from there.

And this is slow going not because it is hard (well, that too), but because I have a severe lack of time due to classes. Who knew that getting a 2nd masters would take so much time? Rhetorical question - I figured I'd give up any personal life the next 2 years.  I am adapting (and so far have a 49.5 / 50 so must be doing something right!). Any free time though goes to family. They all happen to be away today and I've caught up on classes. So here we are!

Wish I had a picture or something. Heck - I'll put in the ugly print I've got now.  I do plan on making this into a better document, and I am really thinking adding graphics - i.e., allow the user to upload stamps and stuff.  Down the road assuming I keep going down the road...

Monday, February 12, 2018

Tracker - printing is hard

Sadly, printing in a UWP app is a lot more difficult than it should be.  I've tried a few things, but in the end, I may end creating an HTML doc internally, and then saving that to a PDF.  I've not really had enough time to go through all the options, and there is a printer helper that in theory allows you to print a UI component, such as a grid.  But the component can't be attached to anything, and there is no simple way to clone a UI element.  I've got some code from Code Project that in theory allows for a deep clone of an element, but it is having issues I need to work through.

I want to get a generic print thing going as more than just the cargo manifest will need to be printed.

And it was a leg day on Monday - never a great way to start off the week!

Monday, February 05, 2018

Tracker - world images, logs now pivot

Switched the world control around a bit, so now the world image (primary image), notes, log and general images are all in a pivot control.  Still need to set the 1st image when the images get loaded - there's always a blank image until you scroll, then that image goes away.

The idea for the world log is to have a date-based log for the worlds just as we do for the ships. I don't think I've actually implemented that though.