Example #1
0
        private void startRecording()
        {
            targetBuilder = new TargetBuilder();
            targetBuilder.StartRecording();

            startStopRecording.Text = "Stop recording";
        }
Example #2
0
        public static void StopRecordingCoordinate(TargetBuilder targetBuilder)
        {
            var target = targetBuilder.Stop();

            if (CurrentFlightReport != null)
            {
                CurrentFlightReport.Targets.AddLast(target);
            }
            else
            {
                Mission.MiscTargets.AddLast(target);
            }

            Mission.AddTargetsToMap();

            Mission.SaveReport(GetPossibleWords);
        }
Example #3
0
        private void stopRecording()
        {
            var info = new BasicTargetInfo {
            };

            if (
                (targetType.SelectedIndex == (int)TargetType.UNASSIGNED) ||
                (targetType.SelectedIndex == (int)TargetType.LETTER && letterInput.Text.Length != 1) ||
                (targetType.SelectedIndex == (int)TargetType.UNKNOWN && unknownDescriptionInput.Text.Length == 0)
                )
            {
                info = InitializeTarget.GetInfo((TargetType)targetType.SelectedIndex, false);
            }
            else
            {
                switch ((TargetType)targetType.SelectedIndex)
                {
                case TargetType.DROP:
                    info.type = TargetType.DROP;
                    break;

                case TargetType.LETTER:
                    info.letter = letterInput.Text[0];
                    info.type   = TargetType.LETTER;
                    break;

                case TargetType.UNKNOWN:
                    info.desc = unknownDescriptionInput.Text;
                    info.type = TargetType.UNKNOWN;
                    break;
                }
            }

            switch (info.type)
            {
            case TargetType.DROP:
                targetBuilder.SetDrop();
                break;

            case TargetType.LETTER:
                targetBuilder.SetLetter(info.letter);
                break;

            case TargetType.UNKNOWN:
                targetBuilder.SetUnknownDescription(info.desc);
                break;
            }

            MissionState.StopRecordingCoordinate(targetBuilder);

            targetBuilder = null;

            Action m = () => {
                letterInput.Text             = "";
                unknownDescriptionInput.Text = "";
                targetType.SelectedIndex     = 0;
                startStopRecording.Text      = "Start Recording";
            };

            this.Invoke(m);
        }