Example #1
0
 //        typedef struct
 //        {
 //            uint16 track_index; /* Index of associated track */
 //            uint16 first_lap_index; /* Index of first associated lap */
 //            uint16 last_lap_index; /* Index of last associated lap */
 //            uint8 sport_type; /* Same as D1000 */
 //            uint8 program_type; /* See below */
 //            uint8 multisport; /* See below */
 //            uint8 unused1; /* Unused. Set to 0. */
 //            uint16 unused2; /* Unused. Set to 0. */
 //            struct
 //            {
 //                uint32 time; /* Time result of quick workout */
 //                float32 distance; /* Distance result of quick workout */
 //            } quick_workout;
 //            D1008_Workout_Type workout; /* Workout */
 //        } D1009_Run_Type;
 public static Run CreateFrom(D1009_Run_Type run_struct)
 {
     var run = new Run();
     run.TrackIndex = run_struct.track_index;
     run.FirstLapIndex = run_struct.first_lap_index;
     run.LastLapIndex = run_struct.last_lap_index;
     run.SportType = (SportType) run_struct.sport_type;
     run.ProgramType = run_struct.program_type;
     run.MultiSport = (MultiSport) run_struct.multisport;
     run.QuickWorkout = run_struct.quick_workout;
     run.Workout = Workout.CreateFrom(run_struct.workout);
     return run;
 }
Example #2
0
//		typedef struct
//		{
//			uint16 track_index; /* Index of associated track */
//			uint16 first_lap_index; /* Index of first associated lap */
//			uint16 last_lap_index; /* Index of last associated lap */
//			uint8 sport_type; /* Same as D1000 */
//			uint8 program_type; /* See below */
//			uint8 multisport; /* See below */
//			uint8 unused1; /* Unused. Set to 0. */
//			uint16 unused2; /* Unused. Set to 0. */
//			struct
//			{
//				uint32 time; /* Time result of quick workout */
//				float32 distance; /* Distance result of quick workout */
//			} quick_workout;
//			D1008_Workout_Type workout; /* Workout */
//		} D1009_Run_Type;

        public static Run CreateFrom(D1009_Run_Type run_struct)
        {
            var run = new Run();

            run.TrackIndex    = run_struct.track_index;
            run.FirstLapIndex = run_struct.first_lap_index;
            run.LastLapIndex  = run_struct.last_lap_index;
            run.SportType     = (SportType)run_struct.sport_type;
            run.ProgramType   = run_struct.program_type;
            run.MultiSport    = (MultiSport)run_struct.multisport;
            run.QuickWorkout  = run_struct.quick_workout;
            run.Workout       = Workout.CreateFrom(run_struct.workout);
            return(run);
        }