⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clangmsgbuilder.cc

📁 在LINUX下运行的仿真机器人服务器源代码
💻 CC
📖 第 1 页 / 共 3 页
字号:
    {      traceBuild< ActClear* >();      add( new ActClear( checkAndGetRegion() ) );     }         void    MsgBuilder::buildActShoot()    {      traceBuild< ActShoot* >();      add( new ActShoot() );    }              void    MsgBuilder::buildActHold()    {      traceBuild< ActHold* >();      add( new ActHold() );     }         void    MsgBuilder::buildActIntercept()    {      traceBuild< ActIntercept* >();      add( new ActIntercept() );     }         void    MsgBuilder::buildActTackle()    {      traceBuild< ActTackle* >();      add( new ActTackle( *checkAndGetUNumSet() ) );     }              void    MsgBuilder::buildDirComm( const bool& do_dont, const bool& our_side )    {      traceBuild< DirComm* >();      DirComm* dir = new DirComm( do_dont, our_side, UNumSet(),                                   std::list< Action* >() );      if( checkIsItem( ACTION ) )        {          while( isItem( ACTION ) )            {		dir->add( getAction() );            }        }      dir->set( *checkAndGetUNumSet() );      add( dir );    }              void    MsgBuilder::buildDirNamed( const std::string& name )    {       traceBuild< DirNamed* >();      add( new DirNamed( name ) );     }              void    MsgBuilder::buildCondTrue()    {      traceBuild< CondBool* >();      add( new CondBool( true ) );     }         void    MsgBuilder::buildCondFalse()    {      traceBuild< CondBool* >();      add( new CondBool( false ) );     }              void    MsgBuilder::buildCondPlayerPos( const bool& our_side,                                           const int& min,                                           const int& max )    {      traceBuild< CondPlayerPos* >();      std::auto_ptr< Region > reg = checkAndGetRegion();       UNumSet unums = *checkAndGetUNumSet();      add( new CondPlayerPos( our_side, unums, min, max, reg ) );    }              void    MsgBuilder::buildCondBallPos()    {      traceBuild< CondBallPos* >();      add( new CondBallPos( checkAndGetRegion() ) );     }         void    MsgBuilder::buildCondBallOwner( const bool& our_side )    {      traceBuild< CondBallOwner* >();      add( new CondBallOwner( our_side, *checkAndGetUNumSet() ) );    }              void    MsgBuilder::buildCondPlayMode( const PlayMode& play_mode )    {      traceBuild< CondPlayMode* >();      add( new CondPlayMode( play_mode ) );     }              void    MsgBuilder::buildCondAnd()    {      traceBuild< CondAnd* >();      CondList l = *checkAndGetCondList();      std::auto_ptr< CondAnd > cond( new CondAnd(l) );      add( cond.release() );    }              void    MsgBuilder::buildCondOr()    {      traceBuild< CondOr* >();      CondList l = *checkAndGetCondList();      std::auto_ptr< CondOr > cond( new CondOr(l) );      add( cond.release() );    }         void    MsgBuilder::buildCondNot()    {      traceBuild< CondNot* >();      add( new CondNot( checkAndGetCond() ) );     }              void    MsgBuilder::buildCondNamed( const std::string& name )    {      traceBuild< CondNamed* >();      add( new CondNamed( name ) );     }         void    MsgBuilder::buildCondTime( const int& time,                                     const util::CompOp& comp )    {      traceBuild< CondTime* >();      add( new CondTime( time, comp ) );     }              void    MsgBuilder::buildCondOppGoal( const int& goals,                                        const util::CompOp& comp )    {      traceBuild< CondOppGoal* >();      add( new CondOppGoal( goals, comp ) );     }         void    MsgBuilder::buildCondOurGoal( const int& goals,                                        const util::CompOp& comp )    {      traceBuild< CondOurGoal* >();      add( new CondOurGoal( goals, comp ) );     }              void    MsgBuilder::buildCondGoalDiff( const int& goals,                                          const util::CompOp& comp )    {      traceBuild< CondGoalDiff* >();      add( new CondGoalDiff( goals, comp ) );     }              void    MsgBuilder::buildCondUNum( const rcss::clang::UNum& unum )    {       traceBuild< CondUNum* >();      add( new CondUNum( unum, *checkAndGetUNumSet() ) );    }              void    MsgBuilder::buildAddToCondList ( )    {      traceBuild< std::list<Cond*> >();      std::auto_ptr<Cond> c = checkAndGetCond();      CondList* l = checkAndGetCondList().release();      l->push_back( c.release() );      add( l );    }        void    MsgBuilder::buildCreateCondList ( )    {      traceBuild< std::list<Cond*> >();      std::auto_ptr<Cond> c = checkAndGetCond();      CondList* l = new CondList();      l->push_back(c.release());      add ( l );    }    void    MsgBuilder::buildRegNull()    {      traceBuild< RegNull* >();      add( new RegNull() );     }              void    MsgBuilder::buildRegQuad()    {      traceBuild< RegQuad* >();      std::auto_ptr< Point > p4 = checkAndGetPoint();      std::auto_ptr< Point > p3 = checkAndGetPoint();      std::auto_ptr< Point > p2 = checkAndGetPoint();      std::auto_ptr< Point > p1 = checkAndGetPoint();      add( new RegQuad( p1, p2, p3, p4 ) );    }              void    MsgBuilder::buildRegArc( const double& start_rad,                                   const double& end_rad,                                   const double& start_ang,                                   const double& span_ang )    {      traceBuild< RegArc* >();      add( new RegArc( checkAndGetPoint(),                       start_rad, end_rad,                       start_ang, span_ang ) );    }              void    MsgBuilder::buildRegUnion()    {	traceBuild< RegUnion* >();	std::auto_ptr< RegUnion > reg( new RegUnion() );	if( checkIsItem( REG ) )        {	    while( isItem( REG ) )		reg->getRegions().push_front( getRegion().release() );	}	add( reg.release() );    }         void    MsgBuilder::buildRegNamed( const std::string& name )    {      traceBuild< RegNamed* >();      add( new RegNamed( name ) );     }         void    MsgBuilder::buildRegPoint()    {      traceBuild< RegPoint* >();      add( new RegPoint( checkAndGetPoint() ) );     }         void    MsgBuilder::buildRegTri()    {      traceBuild< RegTri* >();      std::auto_ptr< Point > p3 = checkAndGetPoint();      std::auto_ptr< Point > p2 = checkAndGetPoint();      std::auto_ptr< Point > p1 = checkAndGetPoint();      add( new RegTri( p1, p2, p3 ) );     }         void    MsgBuilder::buildRegRec()    {      traceBuild< RegRec* >();      std::auto_ptr< Point > p2 = checkAndGetPoint();      std::auto_ptr< Point > p1 = checkAndGetPoint();      add( new RegRec( p1, p2 ) );     }         void    MsgBuilder::buildPointSimple( const double& x, const double& y )    {      traceBuild< PointSimple* >();      add( new PointSimple( x, y ) );     }         void    MsgBuilder::buildPointRel( const double& x, const double& y )    {      traceBuild< PointRel* >();      add( new PointRel( x, y, checkAndGetPoint() ) );     }         void    MsgBuilder::buildPointBall()    {      traceBuild< PointBall* >();      add( new PointBall() );     }              void    MsgBuilder::buildPointPlayer( const bool& our_side,                                        const UNum& unum )    {      traceBuild< PointPlayer* >();      add( new PointPlayer( our_side, unum ) );     }              void    MsgBuilder::buildPointArith( const rcss::util::ArithOp& arith_op )    {      traceBuild< PointArith* >();      // we need to make sure ordering is maintained, otherwise you could end      // up with 'b / a', when 'a / b' was what was actually sent.      std::auto_ptr< Point > second = checkAndGetPoint();      std::auto_ptr< Point > first = checkAndGetPoint();      add( new PointArith( first, second, arith_op ) );     }              void    MsgBuilder::buildUNum( const UNum& unum )    {       traceBuild< UNum* >();      add( new UNum( unum ) );     }         void    MsgBuilder::buildUNumSet()    {       traceBuild< UNumSet >();      UNumSet unums;      if( checkIsItem( UNUM ) )        {          while( isItem( UNUM ) )	      unums.add( *getUNum() );        }      add( new UNumSet( unums ) );     }         void    MsgBuilder::buildBallMoveToken( const BallMoveToken& bmt )    {      traceBuild< BallMoveToken >();      add( bmt );     }        void    MsgBuilder::buildRuleMsg()    {      traceBuild< RuleMsg* >();      RuleMsg* msg = new RuleMsg();      if( checkIsItem( ACTIVATE ) )        {          while( isItem( ACTIVATE ) )	      msg->getList().push_front( *getActivateRules() );        }      setMsg( msg );     }            void    MsgBuilder::buildActivateAllRules( const bool& on )    {      traceBuild< ActivateRules >();      add( new ActivateRules( on, RuleIDList() ) );    }        void    MsgBuilder::buildActivateRules( const bool& on )    {      traceBuild< ActivateRules >();      ActivateRules *act = new ActivateRules( on, RuleIDList() );      if( isItem( RID ) )        {          RuleIDList rids;          rids.push_front( *getRID() );          act->set( rids );        }      else      {          act->set( *checkAndGetRIDList() );      }       add( act );    }        void    MsgBuilder::buildRuleID( const std::string& id )    {      traceBuild< RuleMsg* >();      add( id );    }        void    MsgBuilder::buildRuleIDList()    {      traceBuild< RuleIDList >();      RuleIDList rids;      if( checkIsItem( RID ) )        {          while( isItem( RID ) )	      rids.push_front( *getRID() );          // by adding the items to the front, the original order is          // maintained.        }      add( new RuleIDList( rids ) );     }        void    MsgBuilder::buildRuleIDListALL()    {      traceBuild< RuleIDList >();      add( new RuleIDList() ); // an empty list == all rules.    }        void    MsgBuilder::buildDelMsg()    {      traceBuild< DelMsg* >();      DelMsg* msg = new DelMsg;      if( isItem( RID ) )        {          RuleIDList rids;          rids.push_front( *getRID() );          msg->set( rids );        }      else        {          msg->set( *checkAndGetRIDList() );        }      setMsg( msg );     }        void    MsgBuilder::buildDefineModelRule( const std::string& id )    {      traceBuild< DefRule* >();      add( new DefRule( id, checkAndGetRule(), true ) );     }        void    MsgBuilder::buildDefineDirectiveRule( const std::string& id )    {      traceBuild< DefRule* >();      add( new DefRule( id, checkAndGetRule(), false ) );     }        void    MsgBuilder::buildSimpleRule()    {      traceBuild< SimpleRule* >();      SimpleRule::Storage dirs;      if( checkIsItem( DIR ) )        {          do            {		dirs.push_front( getDir().release() );            }          while( isItem( DIR ) );        }      add( new SimpleRule( checkAndGetCond(), dirs ) );    }        void    MsgBuilder::buildNestedRule()    {      traceBuild< NestedRule* >();      NestedRule::Storage rules;      if( checkIsItem( RULE ) )        {          do            {              rules.push_front( getRule().release() );            }          while( isItem( RULE ) );        }      add( new NestedRule( checkAndGetCond(), rules ) );    }        void    MsgBuilder::buildIDRule()    {      traceBuild< IDListRule* >();      add( new IDListRule( *checkAndGetRIDList() ) );    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -