Saturday, August 12, 2017

Traveller Tracker - adding ship logs

I've added the cargo table definition and the log definition.  Had to also add them to the TravellerContext to get added to the database. That took a bit of digging since it has been a few months since I looked at this sadly.

Anyway, I added an initial dialog box to get a new log entry in. It needs work, and I do believe I am going to abstract that a bit more to have a single class to handle the dialogs to centralize things a bit and minimize repeating code.  I know, a class for a class, so I need to think a bit more on it.

Getting my head wrapped back around C# after more than a year of Filemaker is interesting...

TravellerContext:
using Microsoft.EntityFrameworkCore;
using Traveller.Models;

namespace TravellerTracker.Models
{
    public class TravellerContext : DbContext
    {
        public DbSet Ships { get; set; }
        public DbSet ShipClasses { get; set; }
        public DbSet Cargoes { get; set; }
        public DbSet Logs { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            try
            {
                optionsBuilder.UseSqlite("Data Source=TravellerTracker.db");
            }
            catch (System.Exception ex)
            {
                var a = ex;
                throw;
            }
        }
    }
}





Thursday, August 10, 2017

Traveller Tracker - Ship Classes

So I managed to get a bit more done, and not only can we save off a ship class, we can now add it to a ship.  The UI still needs a LOT of work, but the ideas are there. So the basic ship stuff is there. Still to go is add the ship date and a model to handle the Imperial calendar, the ship log, location and all that.

I am thinking of adding the High Guard ship classes at least as a display or something when creating a ship class, so that you can put in the values from classic Traveller if you want.  I may expand out the ship class to actually include that info. Currently the name was for that, but I think we may need the Imperial Naval Coding System prefix codes.  So that the A1 class I have can be the Billy Bob class of jump 1 traders (low cost and hitting the low pop worlds mostly).


Sunday, August 06, 2017

Traveller Tracker

Well, with my Traveller game finished, I'll try and spend a bit of time on the Traveller Tracker software.  I've got the basic ship entry in place, and now I'm working on the ship class part.  Coming from a DB background, it is all about the various parts and how they fit together.

Hopefully today I'll finish the class entry part. The class determines the ship's basic tonnage, jump, maneuver and power profile, cargo and fuel tonnage.  So in theory, once I figure things out, you could get a list of all ships based on a class.  In reality, the way I used this in the past was only really for 1 ship, but who knows - perhaps some players or GMs have a complete fleet.

So it is a bit slow getting back into this after a few months off: needing to add a new data migration (apparently I added the cargo tonnage later so it is not in the DB yet).

So now we have the basic ship class editor (after the DB migration et al). I need to add that list to th ship editor so that we can choose a class for our ships.

After that, I need to start the ship location side of things. I'll probably use the TravellerMap API for large chunks.  Hopefully I will meet my goal of getting this into the Windows App store by the end of the year for the 4 or 5 people that will use it..

As a side note, the source code is on GitHub, so anyone wanting to try the WIP can in theory download it all and using the free Visual Studio, run it locally.  It is not exactly trivial but nor is it overly complicated (well, speaking as someone who has been coding for far too long...)