Esempio n. 1
0
 public Run(IComparisonGeneratorsFactory factory)
 {
     InternalList         = new List <ISegment>();
     AttemptHistory       = new List <Attempt>();
     Factory              = factory;
     ComparisonGenerators = Factory.Create(this).ToList();
     CustomComparisons    = new List <string>()
     {
         PersonalBestComparisonName
     };
     Metadata = new RunMetadata(this);
 }
        public SpeedrunComSubmitDialog(RunMetadata metadata)
        {
            this.metadata = metadata;

            InitializeComponent();

            hasPersonalBestDateTime = SpeedrunCom.FindPersonalBestAttemptDate(metadata.LiveSplitRun).HasValue;

            if (!hasPersonalBestDateTime)
            {
                var dateLabel = new Label();
                dateLabel.Text = "Date:";
                tableLayoutPanel.Controls.Add(dateLabel, 0, 2);
                dateLabel.Anchor = AnchorStyles.Left;
                dateLabel.AutoSize = true;

                datePicker = new DateTimePicker();
                datePicker.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                tableLayoutPanel.Controls.Add(datePicker, 1, 2);
                tableLayoutPanel.SetColumnSpan(datePicker, 2);
            }
        }
Esempio n. 3
0
 public Run(IComparisonGeneratorsFactory factory)
 {
     InternalList = new List<ISegment>();
     AttemptHistory = new List<Attempt>();
     Factory = factory;
     ComparisonGenerators = Factory.Create(this).ToList();
     CustomComparisons = new List<string>() { PersonalBestComparisonName };
     Metadata = new RunMetadata(this);
 }
Esempio n. 4
0
 private Run(IEnumerable<ISegment> collection, IComparisonGeneratorsFactory factory, RunMetadata metadata)
 {
     InternalList = new List<ISegment>();
     foreach (var x in collection)
     {
         InternalList.Add(x.Clone() as ISegment);
     }
     AttemptHistory = new List<Attempt>();
     Factory = factory;
     ComparisonGenerators = Factory.Create(this).ToList();
     CustomComparisons = new List<string>() { PersonalBestComparisonName };
     Metadata = metadata.Clone(this);
 }
Esempio n. 5
0
 private Run(IEnumerable <ISegment> collection, IComparisonGeneratorsFactory factory, RunMetadata metadata)
 {
     InternalList = new List <ISegment>();
     foreach (var x in collection)
     {
         InternalList.Add(x.Clone() as ISegment);
     }
     AttemptHistory       = new List <Attempt>();
     Factory              = factory;
     ComparisonGenerators = Factory.Create(this).ToList();
     CustomComparisons    = new List <string>()
     {
         PersonalBestComparisonName
     };
     Metadata = metadata.Clone(this);
 }
        public SpeedrunComSubmitDialog(RunMetadata metadata)
        {
            this.metadata = metadata;

            InitializeComponent();

            hasPersonalBestDateTime = SpeedrunCom.FindPersonalBestAttemptDate(metadata.LiveSplitRun).HasValue;

            var row = 2;

            if (!hasPersonalBestDateTime)
            {
                var dateLabel = new Label();
                dateLabel.Text = "Date:";
                tableLayoutPanel.Controls.Add(dateLabel, 0, row);
                dateLabel.Anchor = AnchorStyles.Left;
                dateLabel.AutoSize = true;

                datePicker = new DateTimePicker();
                datePicker.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                datePicker.TabIndex = row;
                tableLayoutPanel.Controls.Add(datePicker, 1, row);
                tableLayoutPanel.SetColumnSpan(datePicker, 2);

                MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + datePicker.Height);
                Size = new Size(Size.Width, Size.Height + datePicker.Height);

                row++;
            }

            var runTime = metadata.LiveSplitRun.Last().PersonalBestSplitTime;

            var timingMethods = metadata.Game.Ruleset.TimingMethods;
            var usesGameTime = timingMethods.Contains(SpeedrunComSharp.TimingMethod.GameTime);
            var usesWithoutLoads = timingMethods.Contains(SpeedrunComSharp.TimingMethod.RealTimeWithoutLoads);
            var usesBoth = usesGameTime && usesWithoutLoads;
            if (!runTime.GameTime.HasValue || usesBoth)
            {
                if (usesWithoutLoads)
                {
                    var label = new Label();
                    label.Text = "Without Loads:";
                    tableLayoutPanel.Controls.Add(label, 0, row);
                    label.Anchor = AnchorStyles.Left;
                    label.AutoSize = true;

                    txtWithoutLoads = new TextBox();
                    txtWithoutLoads.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                    txtWithoutLoads.TabIndex = row;
                    tableLayoutPanel.Controls.Add(txtWithoutLoads, 1, row);
                    tableLayoutPanel.SetColumnSpan(txtWithoutLoads, 2);

                    MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + txtWithoutLoads.Height);
                    Size = new Size(Size.Width, Size.Height + txtWithoutLoads.Height);

                    row++;
                }
                
                if (usesGameTime)
                {
                    var label = new Label();
                    label.Text = "Game Time:";
                    tableLayoutPanel.Controls.Add(label, 0, row);
                    label.Anchor = AnchorStyles.Left;
                    label.AutoSize = true;

                    txtGameTime = new TextBox();
                    txtGameTime.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                    txtGameTime.TabIndex = row;
                    tableLayoutPanel.Controls.Add(txtGameTime, 1, row);
                    tableLayoutPanel.SetColumnSpan(txtGameTime, 2);

                    MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + txtGameTime.Height);
                    Size = new Size(Size.Width, Size.Height + txtGameTime.Height);

                    row++;
                }
            }
        }