///////////////////////////////////////////////////////////
//  Course.cpp
//  Implementation of the Class Course
//  Created on:      12-7-2011 0:02:26
//  Original author: u90499
///////////////////////////////////////////////////////////

#include "Course.h"


Course::Course(int iCourseKind):
m_iCourseKind(iCourseKind)
{
	//in/out切り替え
	iSectionMax = 13;
	//走行知識
	st_section section;

	if(m_iCourseKind == 1){  //In Course

		// スタート時は速度 50 / 200 mm 
		section.lDistance_mm = 200;
		section.lSpeed = 70;// 70;
		section.bLineTrace = true;
		m_section[0] = section;

		// スタートから直線立ち上がりまで 
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[1] = section;

		// 直線
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[2] = section;

		// 直線後・ヘアピン手前
		section.lDistance_mm = 2500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[3] = section;

		// ヘアピン
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[4] = section;

		// ヘアピン後・ R まで
		section.lDistance_mm = 2300;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[5] = section;

		// 第 2 直線
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[6] = section;

		// 第 2 直線後・くの字手前
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[7] = section;

		// くの字
		section.lDistance_mm = 1200;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[8] = section;

		// くの字後・坂道手前
		section.lDistance_mm = 1300;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[9] = section;

		// 坂道
		section.lDistance_mm = 2700;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[10] = section;

		// 坂道後・ゴール過ぎ
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[11] = section;

		// ゴール後・車庫
		section.lDistance_mm = 950;
		section.lSpeed = 70;// 90;
		section.bLineTrace = false;
		m_section[12] = section;
	}else{

		// スタート時は速度 50 / 200 mm 
		section.lDistance_mm = 200;
		section.lSpeed = 70;// 70;
		section.bLineTrace = true;
		m_section[0] = section;

		// スタートから直線立ち上がりまで 
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[1] = section;

		// 直線
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[2] = section;

		// 直線後・ヘアピン手前
		section.lDistance_mm = 2500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[3] = section;

		// ヘアピン
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[4] = section;

		// ヘアピン後・ R まで
		section.lDistance_mm = 2300;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[5] = section;

		// 第 2 直線
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_section[6] = section;

		// 第 2 直線後・くの字手前
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[7] = section;

		// くの字
		section.lDistance_mm = 1200;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[8] = section;

		// くの字後・坂道手前
		section.lDistance_mm = 1300;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_section[9] = section;

		// 坂道
		section.lDistance_mm = 2700;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[10] = section;

		// 坂道後・ゴール過ぎ
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_section[11] = section;

		// ゴール後・車庫
		section.lDistance_mm = 950;
		section.lSpeed = 70;// 90;
		section.bLineTrace = false;
		m_section[12] = section;
	}
}



Course::~Course(){

}
