Exemplo n.º 1
0
 private void GetListOfSuggestedSystems()
 {
     var suggestedSystemNames = new List <string>
     {
         "Sol", "Sadr", "Maia", "Polaris", "EZ Orionis",
         "Kappa-2 Coronae Austrinae", "Eta Carinae", "HR 969", "UX Sculptoris"
     };
     var row              = (SystemGridRow)static_grid.Rows[0].DataBoundItem;
     var system           = StarSystemServices.GetByStarSystemId(row.Id);
     var suggestedSystems = GetListOfSuggestedSystems(system.X, system.Y, system.Z, 16);
 }
Exemplo n.º 2
0
        private void VisitedSystemsGrid_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (e.StateChanged != DataGridViewElementStates.Selected)
            {
                return;
            }
            var row = (SystemGridRow)e.Row.DataBoundItem;

            _currentStarSystem = StarSystemServices.GetByStarSystemId(row.Id);
            RefreshStarSystemControls();
        }
Exemplo n.º 3
0
        private void LogWatcher_Changed(object sender, FileSystemEventArgs e)
        {
            if (e.ChangeType == WatcherChangeTypes.Changed)
            {
                try {
                    LogWatcher.EnableRaisingEvents = false;
                    var system = _logFileHandler.RetrieveNextStarSystem(new FileInfo(e.FullPath));
                    if (null != system)
                    {
                        if (!StarSystemServices.SystemPreviouslyVisited(system.Name))
                        {
                            if (!string.IsNullOrWhiteSpace(DistToNextText.Text))
                            {
                                double distToNext = 0;
                                if (double.TryParse(DistToNextText.Text, out distToNext))
                                {
                                    system.DistToNext = distToNext;
                                    DistToNextText.Clear();
                                }
                            }

                            system.Visits = 1;
                            var savedSystem = StarSystemServices.InsertStarSystem(system);
                            if (null != savedSystem)
                            {
                                Main.LogRichText(string.Format("Arrival at System: {0}", savedSystem.Name), Color.Blue);
                                _systemObjects   = new BindingList <SystemObject>();
                                SystemLabel.Text = savedSystem.Name;
                                PopulateSystemGrid();
                            }
                        }
                        else
                        {
                            Main.LogRichText(string.Format("Arrival at System: {0} - Previously Visited", system.Name), Color.Navy);
                        }
                    }
                } finally {
                    LogWatcher.EnableRaisingEvents = true;
                }
            }
        }
Exemplo n.º 4
0
        private void PopulateSystemGrid()
        {
            if (_currentExpedition == null)
            {
                return;
            }
            var data = StarSystemServices.GetLastNSystems(_currentExpedition);

            static_grid.DataSource         = data;
            static_grid.Columns[1].Width   = 150;
            static_grid.Columns[2].Width   = 330;
            static_grid.Columns[3].Width   = 68;
            static_grid.Columns[0].Visible = false;
            SystemGridRow row = null;

            if (data.Count < 1)
            {
                return;
            }
            row = (SystemGridRow)static_grid.Rows[0].DataBoundItem;
            //_currentStarSystem = StarSystemServices.GetByStarSystemId(row.Id);
            //RefreshStarSystemControls();
        }
Exemplo n.º 5
0
        private void GetDistanceTravelled()
        {
            var total = StarSystemServices.GetTotalDistance(_currentExpedition);

            TotalDistanceText.Text = total.ToString("###0.00");
        }
Exemplo n.º 6
0
 private void Discovered_Click(object sender, EventArgs e)
 {
     _currentStarSystem.Discovered = Discovered.Checked;
     _currentStarSystem            = StarSystemServices.UpdateStarSystem(_currentStarSystem);
 }
Exemplo n.º 7
0
 private void Bookmark_Click(object sender, EventArgs e)
 {
     _currentStarSystem.IsBookMarked = Bookmark.Checked;
     _currentStarSystem = StarSystemServices.UpdateStarSystem(_currentStarSystem);
 }
Exemplo n.º 8
0
 private void Refuel_Click(object sender, EventArgs e)
 {
     _currentStarSystem.Refuel = Refuel.Checked;
     // _currentStarSystem.Expedition = _currentExpedition;
     _currentStarSystem = StarSystemServices.UpdateStarSystem(_currentStarSystem);
 }