package game;

import framework.model3D.BaseObject3D;
import framework.model3D.Position3D;
import framework.physics.Ground;

public class Stage extends Ground {
	public static final int TEAM_RED = 0;
	public static final int TEAM_BLUE = 1;
	
	//blueteamのスポーンポイント
	Position3D Bluespawnpoint[] = {
			new Position3D(-150,7,10), 
			new Position3D(-150,7,0), 
			new Position3D(-150,7,-10)};
	//redteamのスポーンポイント
	Position3D Redspawnpoint[]= {
			new Position3D(140,7,10),
	        new Position3D(140,7,0),
	        new Position3D(140,7,-10)};
	
	//goallineはx=120, -120で設定
	
	//チーム毎のスポーンポイントを返す
	public Position3D getSpawnPoint(int team,int no) {
		if(team == TEAM_RED){
			return Redspawnpoint[no];
		} else {
			return Bluespawnpoint[no];
		}	
	}

	//ゴール判定
	public boolean isFinished(int team, Position3D p){
		double player_pointX = p.getX();
		//teamRed
		if(team == TEAM_RED){
			if(player_pointX <= -120){
				return true;
			}
		//teamBlue
        } else if(team == TEAM_BLUE){
        	 if(player_pointX >= 120){	
				return true;
			 }
        }
		//ゴールしていない
		return false;		
	}
}