www.pudn.com > Product_Submit2004.rar > RobotState.h, change:2004-04-22,size:1102b


#ifndef ROBOT_STATE_H 
#define ROBOT_STATE_H 
 
class RobotState { 
public: 
	enum State { 
		ST_INITIAL, 
		ST_READY, 
    ST_SET, 
		ST_PLAYING, 
    ST_PENALIZED, 
    ST_FINISHED 
	}; 
 
	enum Team { 
		RT_RED, 
		RT_BLUE 
	}; 
	 
	enum KickOff { 
		KO_OWN = 1, 
		KO_OPPONENT = 2 
	}; 
 
	RobotState() { 
    currState = ST_INITIAL; 
    currTeam = RT_RED; 
    kickOff  = KO_OWN; 
  } 
	 
	State GetState() {return currState;} 
	void SetState(State s) {currState = s;} 
 
	Team GetTeam() {return currTeam;} 
	void SetTeam(Team t) {currTeam = t;} 
	void ToggleTeam() {if (currTeam == RT_RED) currTeam = RT_BLUE; else currTeam = RT_RED;} 
 
	void SetKickOff(KickOff style) {kickOff = style;} 
	KickOff GetKickOff() {return kickOff;} 
  void ToggleKickOff() {if (kickOff == KO_OWN) kickOff = KO_OPPONENT; else kickOff = KO_OWN;} 
	void SetScore(int y,int o) {ownScore = y; oppScore = o;} 
	int GetOwnScore() {return ownScore;} 
	int GetOppScore() {return oppScore;} 
 
 
private: 
	State currState; 
	Team currTeam; 
	KickOff kickOff; 
	int ownScore; 
	int oppScore; 
}; 
 
#endif // ROBOT_STATE_H