public ScenarioComponent(string name)
 {
     _scenarioName = name;
     SimParams     = new SimulationParameters();
     SchParams     = new SchedulerParameters();
     TargetDeck    = new TargetdeckComponent();
     Environment   = new EnvironmentComponent();
     Model         = new ModelComponent();
     Results       = new ResultsComponent();
 }
        public object Clone()
        {
            // Returns a deep (value-wise) copy of the object
            TargetdeckComponent copy = new TargetdeckComponent();

            foreach (TargetComponent t in Targets)
            {
                copy.AddTarget(t);
            }
            return(copy);
        }
 public TargetdeckForm(TargetdeckComponent targetComponent, Form parentWindow)
 {
     InitializeComponent();
     _aspectRatio = (float)Width / (float)Height;
     Tag          = targetComponent;
     hComponent   = targetComponent;
     targetIcons  = new List <TargetIcon>();
     MdiParent    = parentWindow;
     _mManager    = new MementoManager((IMForm)MdiParent);
     Text         = "Target Deck";
     RefreshTargets();
 }
 public void Clone(object value)
 {
     // Writes a deep (value-wise) copy onto the object from value
     if (value.GetType() == typeof(TargetdeckComponent))
     {
         TargetdeckComponent v = (TargetdeckComponent)value;
         Targets.Clear();
         foreach (TargetComponent t in v.Targets)
         {
             AddTarget(t);
         }
     }
 }
        public void AddNewTarget(double latitude, double longitude)
        {
            TargetdeckComponent before = (TargetdeckComponent)hComponent.Clone();

            // Create new component
            TargetComponent newTarget = new TargetComponent(latitude, longitude);

            hComponent.AddTarget(newTarget);

            // Create new icon
            double     x       = (longitude + 180.0) * worldMap.Size.Width / 360.0;
            double     y       = (latitude + 90.0) * worldMap.Size.Height / 180.0;
            TargetIcon newIcon = new TargetIcon(newTarget);

            newIcon.Location = new Point((int)x, (int)y);
            newIcon.Visible  = true;
            newIcon.Tag      = newTarget;
            targetIcons.Add(newIcon);
            Controls.Add(newIcon);
            newIcon.BringToFront();

            // Register event
            _mManager.RegisterEvent(before, hComponent, hComponent, "Add Target");
        }