Exemplo n.º 1
0
        /// <summary>
        /// Create a new task based on a reference task from which the different parameters will be copied.
        /// </summary>
        /// <param name="id">The ID of the new task, potentially different from the reference task.</param>
        /// <param name="refTask">The parent task from which parameters will be copied</param>
        /// <param name="linkingType">Controls the possible sharing with the reference task some data structure</param>
        protected SimulationTask(int id, SimulationTask refTask, TaskLinkingType linkingType)
        {
            this.id      = id;
            this.refTask = refTask;
            Reset();
            {            //Always linked
                this.crewmanTypes = refTask.crewmanTypes;
                this.phaseTypes   = refTask.phaseTypes;
            }
            switch (linkingType)
            {
            case TaskLinkingType.Linked:
                this.simulationCurrentQualifications = refTask.simulationCurrentQualifications;
                this.parallelTasks = refTask.parallelTasks;
                this.slaveTasks    = refTask.slaveTasks;
                this.masterTasks   = refTask.masterTasks;
                break;

            case TaskLinkingType.Copy:
                //this.crewmanTypes = refTask.crewmanTypes.ToList();
                //this.phaseTypes = refTask.phaseTypes.ToList();
                this.simulationCurrentQualifications = new Dictionary <Crewman, byte>(this.refTask.simulationCurrentQualifications);
                this.parallelTasks = new Dictionary <int, SimulationTask>(this.refTask.parallelTasks);
                this.slaveTasks    = new Dictionary <int, SimulationTask>(this.refTask.slaveTasks);
                this.masterTasks   = new Dictionary <int, SimulationTask>(this.refTask.masterTasks);
                break;

            case TaskLinkingType.Clear:
            default:
                //this.crewmanTypes = refTask.crewmanTypes.ToList();
                //this.phaseTypes = refTask.phaseTypes.ToList();
                this.simulationCurrentQualifications = new Dictionary <Crewman, byte>(this.refTask.simulationCurrentQualifications);
                this.parallelTasks = new Dictionary <int, SimulationTask>();
                this.slaveTasks    = new Dictionary <int, SimulationTask>();
                this.masterTasks   = new Dictionary <int, SimulationTask>();
                break;
            }
            this.refTask = refTask.RootTask;
        }
Exemplo n.º 2
0
 internal BasicTask(int id, SimulationTask refTask, TaskLinkingType linkingType = TaskLinkingType.Linked) : base(id, refTask, linkingType)
 {
 }
Exemplo n.º 3
0
 public BasicTask(SimulationTask refTask, TaskLinkingType linkingType = TaskLinkingType.Linked) : base(refTask, linkingType)
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new task based on a reference task from which the different parameters will be copied (including task ID).
 /// </summary>
 /// <param name="refTask">The parent task from which parameters will be copied</param>
 /// <param name="linkingType">Controls the possible sharing with the reference task some data structures</param>
 protected SimulationTask(SimulationTask refTask, TaskLinkingType linkingType) : this(refTask.id, refTask, linkingType)
 {
 }
Exemplo n.º 5
0
 protected internal abstract SimulationTask CreateTask(int id, SimulationTask refTask, TaskLinkingType linkingType);             //TODO: Make protected internal
Exemplo n.º 6
0
 public abstract SimulationTask CreateTask(SimulationTask refTask, TaskLinkingType linkingType);
Exemplo n.º 7
0
 protected internal override SimulationTask CreateTask(int id, SimulationTask refTask, TaskLinkingType linkingType)
 {
     return(new BasicTask(id, refTask, linkingType));
 }
Exemplo n.º 8
0
 public override SimulationTask CreateTask(SimulationTask refTask, TaskLinkingType linkingType)
 {
     return(new BasicTask(refTask, linkingType));
 }