clangaction.cpp
来自「2009 ROBOCUP 仿真2DSERVER 源码」· C++ 代码 · 共 1,385 行 · 第 1/2 页
CPP
1,385 行
std::ostream &ActMarkLineReg::printPretty( std::ostream & out, const std::string & line_header ) const{ out << line_header << "mark line to region:" << std::endl; if ( getRegion() == NULL ) { out << line_header << " (null)\n"; } else { getRegion()->printPretty( out, line_header + " " ); } return out;}constRegion *ActMarkLineReg::getRegion() const{ return m_reg.get();}std::auto_ptr< Region >ActMarkLineReg::detachRegion(){ return m_reg;}std::auto_ptr< Action >ActMarkLineReg::deepCopy() const{ if ( getRegion() ) { return std::auto_ptr< Action >( new ActMarkLineReg( getRegion()->deepCopy() ) ); } else { return std::auto_ptr< Action >( new ActMarkLineReg() ); }}ActOffsidesLine::ActOffsidesLine() : Action(){}ActOffsidesLine::ActOffsidesLine( std::auto_ptr< Region > r ) : Action(), m_reg( r ){}ActOffsidesLine::~ActOffsidesLine(){}std::auto_ptr< Action >ActOffsidesLine::deepCopy() const{ if ( getRegion() ) { return std::auto_ptr< Action >( new ActOffsidesLine( getRegion()->deepCopy() ) ); } else { return std::auto_ptr< Action >( new ActOffsidesLine() ); }}std::ostream &ActOffsidesLine::print( std::ostream & out ) const{ out << "(oline "; if ( getRegion() == NULL ) { out << "(null)"; } else { out << *getRegion(); } return out << ")";}std::ostream &ActOffsidesLine::printPretty( std::ostream & out, const std::string & line_header ) const{ out << line_header << "offsides line at: " << std::endl; if ( getRegion() == NULL ) { out << line_header << " (null)\n"; } else { getRegion()->printPretty( out, line_header + " " ); } return out;}constRegion *ActOffsidesLine::getRegion() const{ return m_reg.get();}std::auto_ptr< Region >ActOffsidesLine::detachRegion(){ return m_reg;}ActHetType::ActHetType() : Action(), M_player_type( 0 ){}ActHetType::ActHetType( const int & player_type ) : Action(), M_player_type( player_type ){}ActHetType::~ActHetType(){}std::auto_ptr< Action >ActHetType::deepCopy() const{ return std::auto_ptr< Action >( new ActHetType( *this ) );}std::ostream &ActHetType::print( std::ostream & out ) const{ return out << "(htype " << M_player_type << ")";}std::ostream &ActHetType::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "heterogenous type: " << M_player_type << std::endl;}intActHetType::getPlayerType() const{ return M_player_type;}voidActHetType::setPlayerType( const int player_type ){ M_player_type = player_type;}ActNamed::ActNamed( const std::string & name ) : Action(), M_name( name ){}ActNamed::~ActNamed(){}std::auto_ptr< Action >ActNamed::deepCopy() const{ return std::auto_ptr< Action >( new ActNamed( *this ) );}std::ostream &ActNamed::print( std::ostream & out ) const{ return out << "\"" << M_name << "\"";}std::ostream &ActNamed::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "action named \"" << M_name << "\"" << std::endl;}std::string &ActNamed::getName(){ return M_name;}conststd::string &ActNamed::getName() const{ return M_name;}voidActNamed::setName( const std::string & name ){ M_name = name;}ActPassReg::ActPassReg() : Action(){}ActPassReg::ActPassReg( std::auto_ptr< Region > reg ) : Action(), m_reg( reg ){}ActPassReg::~ActPassReg(){}std::auto_ptr< Action >ActPassReg::deepCopy() const{ if ( getRegion() ) { return std::auto_ptr< Action >( new ActPassReg( getRegion()->deepCopy() ) ); } else { return std::auto_ptr< Action >( new ActPassReg() ); }}std::ostream &ActPassReg::print( std::ostream & out ) const{ out << "(pass "; if ( getRegion() == NULL ) { out << "(null)"; } else { out << *getRegion(); } return out << ")";}std::ostream &ActPassReg::printPretty( std::ostream & out, const std::string & line_header ) const{ out << line_header << "pass to region:" << std::endl; if ( getRegion() == NULL ) { out << line_header << " (null)\n"; } else { getRegion()->printPretty( out, line_header + " " ); } return out;}constRegion *ActPassReg::getRegion() const{ return m_reg.get();}std::auto_ptr< Region >ActPassReg::detachRegion(){ return m_reg;}ActPassUNum::ActPassUNum() : Action(){}ActPassUNum::ActPassUNum( const UNumSet & players ) : Action(), m_players( players ){}ActPassUNum::~ActPassUNum(){}std::auto_ptr< Action >ActPassUNum::deepCopy() const{ return std::auto_ptr< Action >( new ActPassUNum( *this ) );}std::ostream &ActPassUNum::print( std::ostream & out ) const{ return out << "(pass " << getPlayers() << ")";}std::ostream &ActPassUNum::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "pass to player(s) " << getPlayers() << std::endl;}UNumSet &ActPassUNum::getPlayers(){ return m_players;}constUNumSet &ActPassUNum::getPlayers() const{ return m_players;}voidActPassUNum::add( const UNum & unum ){ m_players.add( unum );}voidActPassUNum::clearPlayers(){ m_players.clear();}ActDribble::ActDribble() : Action(){}ActDribble::ActDribble( std::auto_ptr< Region > reg ) : Action(), m_reg( reg ){}ActDribble::~ActDribble(){}std::auto_ptr< Action >ActDribble::deepCopy() const{ if ( getRegion() ) { return std::auto_ptr< Action >( new ActDribble( getRegion()->deepCopy() ) ); } else { return std::auto_ptr< Action >( new ActDribble() ); }}std::ostream &ActDribble::print( std::ostream & out ) const{ out << "(dribble "; if ( getRegion() == NULL ) { out << "(null)"; } else { out << *getRegion(); } return out << ")";}std::ostream &ActDribble::printPretty( std::ostream & out, const std::string & line_header ) const{ out << line_header << "dribble to region:" << std::endl; if ( getRegion() == NULL ) { out << line_header << " (null)\n"; } else { getRegion()->printPretty( out, line_header + " " ); } return out;}constRegion *ActDribble::getRegion() const{ return m_reg.get();}std::auto_ptr< Region >ActDribble::detachRegion(){ return m_reg;}ActClear::ActClear() : Action(){}ActClear::ActClear( std::auto_ptr< Region > reg ) : Action(), m_reg( reg ){}ActClear::~ActClear(){}std::auto_ptr< Action >ActClear::deepCopy() const{ if ( getRegion() ) { return std::auto_ptr< Action >( new ActClear( getRegion()->deepCopy() ) ); } else { return std::auto_ptr< Action >( new ActClear() ); }}std::ostream &ActClear::print( std::ostream & out ) const{ out << "(clear "; if ( getRegion() == NULL ) { out << "(null)"; } else { out << *getRegion(); } return out << ")";}std::ostream &ActClear::printPretty( std::ostream & out, const std::string & line_header ) const{ out << line_header << "clear to region:" << std::endl; if ( getRegion() == NULL ) { out << line_header << " (null)\n"; } else { getRegion()->printPretty( out, line_header + " " ); } return out;}constRegion *ActClear::getRegion() const{ return m_reg.get();}std::auto_ptr< Region >ActClear::detachRegion(){ return m_reg;}ActShoot::ActShoot() : Action(){}ActShoot::~ActShoot(){}std::auto_ptr< Action >ActShoot::deepCopy() const{ return std::auto_ptr< Action >( new ActShoot( *this ) );}std::ostream &ActShoot::print( std::ostream & out ) const{ return out << "(shoot)";}std::ostream &ActShoot::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "shoot" << std::endl;}ActHold::ActHold() : Action(){}ActHold::~ActHold(){}std::auto_ptr< Action >ActHold::deepCopy() const{ return std::auto_ptr< Action >( new ActHold( *this ) );}std::ostream &ActHold::print( std::ostream & out ) const{ return out << "(hold)";}std::ostream &ActHold::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "hold" << std::endl;}ActIntercept::ActIntercept() : Action(){}ActIntercept::~ActIntercept(){}std::auto_ptr< Action >ActIntercept::deepCopy() const{ return std::auto_ptr< Action >( new ActIntercept( *this ) );}std::ostream &ActIntercept::print( std::ostream & out ) const{ return out << "(intercept)";}std::ostream &ActIntercept::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "intercept" << std::endl;}ActTackle::ActTackle() : Action(){}ActTackle::ActTackle( const UNumSet & players ) : Action(), M_players( players ){}ActTackle::~ActTackle(){}std::auto_ptr< Action >ActTackle::deepCopy() const{ return std::auto_ptr< Action >( new ActTackle( *this ) );}std::ostream &ActTackle::print( std::ostream & out ) const{ return out << "(tackle " << M_players << ")";}std::ostream &ActTackle::printPretty( std::ostream & out, const std::string & line_header ) const{ return out << line_header << "tackle player(s) " << M_players << std::endl;}UNumSet &ActTackle::getPlayers(){ return M_players;}constUNumSet &ActTackle::getPlayers() const{ return M_players;}voidActTackle::setPlayers( const UNumSet & players ){ M_players = players;}voidActTackle::addPlayer( const UNum & i ){ M_players.add( i );}voidActTackle::clearPlayers(){ M_players.clear();}std::ostream &operator<<( std::ostream & os, const Action & a ){ return a.print( os );}}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?