public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(DataOrigin.ToStepValue()); parameters.Add(UserDefinedDataOrigin != null ? UserDefinedDataOrigin.ToStepValue() : "$"); parameters.Add(DurationType.ToStepValue()); parameters.Add(ScheduleDuration != null ? ScheduleDuration.ToStepValue() : "$"); parameters.Add(ScheduleStart != null ? ScheduleStart.ToStepValue() : "$"); parameters.Add(ScheduleFinish != null ? ScheduleFinish.ToStepValue() : "$"); parameters.Add(EarlyStart != null ? EarlyStart.ToStepValue() : "$"); parameters.Add(EarlyFinish != null ? EarlyFinish.ToStepValue() : "$"); parameters.Add(LateStart != null ? LateStart.ToStepValue() : "$"); parameters.Add(LateFinish != null ? LateFinish.ToStepValue() : "$"); parameters.Add(FreeFloat != null ? FreeFloat.ToStepValue() : "$"); parameters.Add(TotalFloat != null ? TotalFloat.ToStepValue() : "$"); parameters.Add(IsCritical != null ? IsCritical.ToStepValue() : "$"); parameters.Add(StatusTime != null ? StatusTime.ToStepValue() : "$"); parameters.Add(ActualDuration != null ? ActualDuration.ToStepValue() : "$"); parameters.Add(ActualStart != null ? ActualStart.ToStepValue() : "$"); parameters.Add(ActualFinish != null ? ActualFinish.ToStepValue() : "$"); parameters.Add(RemainingTime != null ? RemainingTime.ToStepValue() : "$"); parameters.Add(Completion != null ? Completion.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
internal void FixedUpdate() { if (!LateStartInvoked) { LateStart?.Invoke(); LateStartInvoked = true; } Hooks.FixedUpdate?.Invoke(); }
// Destroy the current version of the world private IEnumerator ClearWorld() { stage = CreationStage.destruction; SetProgress(0.0f); yield return(null); // ~~~ end frame // Clear beacons from late start LateStartCall = null; // Get list of pickups remaining PickupItem[] pickups = FindObjectsOfType <PickupItem>(); // Calculate total grids in world int gridCount = world.width / 10 * world.height / 10; // Set remaining operations to pickups + grid destruction int operations = pickups.Length + gridCount + 1; // Get grids from world Grid[,] grids = instantiatedWorldScript.grids; int cleared = 0; // Destroy grids foreach (Grid g in grids) { if (g != null) { Destroy(g.gameObject); cleared++; SetProgress((float)cleared / operations); yield return(null); } } // Destroy world Destroy(instantiatedWorld.gameObject); SetProgress((float)(cleared + 1) / operations); yield return(null); // ~~~ end frame // Destroy any left-over pickups if (pickups.Length > 0) { for (int i = 0; i < pickups.Length; ++i) { Destroy(pickups[i].gameObject); SetProgress((operations - pickups.Length + i + 1) / operations); yield return(null); // ~~~ end frame } } yield return(new WaitForSeconds(0.3f)); }
public int CompareFieldValueTo(FieldIndex field, Solution other) { switch (field) { case FieldIndex.TimeAtUni: return(TimeAtUni.CompareTo(other.TimeAtUni)); case FieldIndex.TimeInClasses: return(TimeInClasses.CompareTo(other.TimeInClasses)); case FieldIndex.TimeInBreaks: return(TimeInBreaks.CompareTo(other.TimeInBreaks)); case FieldIndex.Days: return(Days.CompareTo(other.Days)); case FieldIndex.MinDayLength: return(MinDayLength.CompareTo(other.MinDayLength)); case FieldIndex.MaxDayLength: return(MaxDayLength.CompareTo(other.MaxDayLength)); case FieldIndex.AverageDayLength: return(AverageDayLength.CompareTo(other.AverageDayLength)); case FieldIndex.ShortBreak: return(ShortBreak.CompareTo(other.ShortBreak)); case FieldIndex.LongBreak: return(LongBreak.CompareTo(other.LongBreak)); case FieldIndex.AverageBreak: return(AverageBreak.CompareTo(other.AverageBreak)); case FieldIndex.NumberBreaks: return(NumberBreaks.CompareTo(other.NumberBreaks)); case FieldIndex.ShortBlock: return(ShortBlock.CompareTo(other.ShortBlock)); case FieldIndex.LongBlock: return(LongBlock.CompareTo(other.LongBlock)); case FieldIndex.AverageBlock: return(AverageBlock.CompareTo(other.AverageBlock)); case FieldIndex.NumberBlocks: return(NumberBlocks.CompareTo(other.NumberBlocks)); case FieldIndex.EarlyStart: return(EarlyStart.CompareTo(other.EarlyStart)); case FieldIndex.LateStart: return(LateStart.CompareTo(other.LateStart)); case FieldIndex.AverageStart: return(AverageStart.CompareTo(other.AverageStart)); case FieldIndex.EarlyEnd: return(EarlyEnd.CompareTo(other.EarlyEnd)); case FieldIndex.LateEnd: return(LateEnd.CompareTo(other.LateEnd)); case FieldIndex.AverageEnd: return(AverageEnd.CompareTo(other.AverageEnd)); default: return(0); } }
/*public IComparable Field(int field) * { * switch (field) * { * case 0: * return (IComparable)TimeAtUni_; * case 1: * return (IComparable)TimeInClasses_; * case 2: * return (IComparable)TimeInBreaks_; * case 3: * return Days_; * case 4: * return (IComparable)MinDayLength_; * case 5: * return (IComparable)MaxDayLength_; * case 6: * return (IComparable)AverageDayLength_; * case 7: * return (IComparable)ShortBreak_; * case 8: * return (IComparable)LongBreak_; * case 9: * return (IComparable)AverageBreak_; * case 10: * return NumberBreaks_; * case 11: * return (IComparable)ShortBlock_; * case 12: * return (IComparable)LongBlock_; * case 13: * return (IComparable)AverageBlock_; * case 14: * return NumberBlocks_; * case 15: * return (IComparable)EarlyStart_; * case 16: * return (IComparable)LateStart_; * case 17: * return (IComparable)AverageStart_; * case 18: * return (IComparable)EarlyEnd_; * case 19: * return (IComparable)LateEnd_; * case 20: * return (IComparable)AverageEnd_; * default: * throw new Exception("Field index out of range."); * } * }*/ public string FieldValueToString(FieldIndex field) { switch (field) { case FieldIndex.TimeAtUni: return(TimeAtUni.ToString()); case FieldIndex.TimeInClasses: return(TimeInClasses.ToString()); case FieldIndex.TimeInBreaks: return(TimeInBreaks.ToString()); case FieldIndex.Days: return(Days.ToString()); case FieldIndex.MinDayLength: return(MinDayLength.ToString()); case FieldIndex.MaxDayLength: return(MaxDayLength.ToString()); case FieldIndex.AverageDayLength: return(AverageDayLength.ToString()); case FieldIndex.ShortBreak: return(ShortBreak.ToString()); case FieldIndex.LongBreak: return(LongBreak.ToString()); case FieldIndex.AverageBreak: return(AverageBreak.ToString()); case FieldIndex.NumberBreaks: return(NumberBreaks.ToString()); case FieldIndex.ShortBlock: return(ShortBlock.ToString()); case FieldIndex.LongBlock: return(LongBlock.ToString()); case FieldIndex.AverageBlock: return(AverageBlock.ToString()); case FieldIndex.NumberBlocks: return(NumberBlocks.ToString()); case FieldIndex.EarlyStart: return(EarlyStart.ToString()); case FieldIndex.LateStart: return(LateStart.ToString()); case FieldIndex.AverageStart: return(AverageStart.ToString()); case FieldIndex.EarlyEnd: return(EarlyEnd.ToString()); case FieldIndex.LateEnd: return(LateEnd.ToString()); case FieldIndex.AverageEnd: return(AverageEnd.ToString()); default: return(""); } }