コード例 #1
0
ファイル: GalaxyScene.cs プロジェクト: weshec/Stareater
        public void SwitchPlayer(PlayerController player)
        {
            player.RunAutomation();

            this.currentPlayer = player;

            if (!this.viewpoints.ContainsKey(player.PlayerIndex))
            {
                viewpoints[player.PlayerIndex] = new PlayerViewpoint(this.currentPlayer.Stars.Select(star => convert(star.Position)), StarMinClickRadius);
            }

            this.updateSelection();
            this.setupPerspective();
            this.setupFuelInfo();

            var filter = new FilterRepotVisitor();

            if (this.currentPlayer.Reports.Any(filter.ShowItem))
            {
                this.reportsButton.ForgroundImage = GalaxyTextures.Get.NewReports;
                this.showReports();
            }
            else
            {
                this.reportsButton.ForgroundImage = GalaxyTextures.Get.Reports;
            }
        }
コード例 #2
0
        private void fillList()
        {
            reportList.Controls.Clear();

            var filter = new FilterRepotVisitor();

            foreach (var report in reports)
            {
                report.Accept(filter);
                if (!filter.ShowItem)
                {
                    continue;
                }

                var reportItem = new ReportItem();
                reportItem.Data = report;

                reportList.Controls.Add(reportItem);
            }
        }
コード例 #3
0
ファイル: FormReports.cs プロジェクト: weshec/Stareater
        private void fillList()
        {
            this.reportList.Controls.Clear();

            var filter = new FilterRepotVisitor();

            foreach (var report in this.reports.Where(filter.ShowItem))
            {
                this.reportList.Controls.Add(new ReportItem {
                    Data = report
                });
            }

            if (!this.reports.Any())
            {
                this.reportList.Controls.Add(new Label {
                    AutoSize = true,
                    Text     = LocalizationManifest.Get.CurrentLanguage["FormReports"]["noReports"].Text()
                });
                this.openButton.Enabled   = false;
                this.filterButton.Enabled = false;
            }
        }