📄 serializerplayerstdv1.cc
字号:
double mag ) const { strm << " (speed " << mag << ")"; } void SerializerPlayerStdv1::serializeBodyVelocity( std::ostream& strm, double mag, int head ) const { strm << " (speed " << mag << " " << head << ")"; } void SerializerPlayerStdv1::serializeBodyCounts( std::ostream& strm, int count_kick, int count_dash, int count_turn, int count_say ) const { strm << " (kick " << count_kick << ")"; strm << " (dash " << count_dash << ")"; strm << " (turn " << count_turn << ")"; strm << " (say " << count_say << ")"; } void SerializerPlayerStdv1::serializeBodyCounts( std::ostream& strm, int count_catch, int count_move, int count_change_view ) const { strm << " (catch " << count_catch << ")"; strm << " (move " << count_move << ")"; strm << " (change_view " << count_change_view << ")"; } void SerializerPlayerStdv1::serializeNeckAngle( std::ostream& strm, int ang ) const { strm << " (head_angle " << ang << ")"; } void SerializerPlayerStdv1::serializeNeckCount( std::ostream& strm, int count_turn_neck ) const { strm << " (turn_neck " << count_turn_neck << ")"; } void SerializerPlayerStdv1::serializeArm( std::ostream& strm, int movable_cycles, int expires_cycles, double dist, int head, int count ) const { strm << " (arm"; strm << " (movable " << movable_cycles << ")"; strm << " (expires " << expires_cycles << ")"; strm << " (target " << dist << " " << head << ")"; strm << " (count " << count << ")"; strm << ")"; } void SerializerPlayerStdv1::serializeFocus( std::ostream& strm, const char* name, int count ) const { strm << " (focus"; strm << " (target " << name << ")"; strm << " (count " << count << ")"; strm << ")"; } void SerializerPlayerStdv1::serializeFocus( std::ostream& strm, const char* team, int unum, int count ) const { strm << " (focus"; strm << " (target " << team << " " << unum << ")"; strm << " (count " << count << ")"; strm << ")"; } void SerializerPlayerStdv1::serializeTackle( std::ostream& strm, int cycles, int count ) const { strm << " (tackle"; strm << " (expires " << cycles << ")"; strm << " (count " << count << ")"; strm << ")"; } void SerializerPlayerStdv1::serializeFSBegin( std::ostream& strm, int time ) const { strm.precision(6); strm << "(fullstate " << time; } void SerializerPlayerStdv1::serializeFSEnd( std::ostream& strm) const { strm << ")"; } void SerializerPlayerStdv1::serializeFSViewMode( std::ostream& strm, const char* qual, const char* width ) const { strm << " (vmode " << qual << " " << width << ")"; } void SerializerPlayerStdv1::serializeFSPlayMode( std::ostream& strm, const char* mode ) const { strm << " (pmode " << mode << ")"; } // caution: in version 5 left is the points for the left team // and right is the points for the right team. In version 8 // and later left is the points of the players team and right // is the points for the opp void SerializerPlayerStdv1::serializeFSScore( std::ostream& strm, int left, int right ) const { strm << " (score " << left << " " << right << ")"; } void SerializerPlayerStdv1::serializeFSBall( std::ostream& strm, double x, double y, double vel_x, double vel_y ) const { strm << " (ball" << " " << x << " " << y << " " << vel_x << " " << vel_y << ")"; } void SerializerPlayerStdv1::serializeFSPlayerBegin( std::ostream& strm, char side, int unum, bool, int, double x, double y, double vel_x, double vel_y, double body_dir, double neck_dir ) const { strm << " (" << side << "_" << unum << " " << x << " " << y << " " << vel_x << " " << vel_y << " " << body_dir << " " << neck_dir; } void SerializerPlayerStdv1::serializeFSPlayerEnd( std::ostream& strm, double stamina, double effort, double recovery ) const { strm << " " << stamina << " " << effort << " " << recovery << ")"; } void SerializerPlayerStdv1::serializeInit( std::ostream& strm, const char* side, int unum, const PlayMode& mode ) const { strm << "(init " << side << " " << unum << " " << PlayModeString[ mode ] << ")"; } void SerializerPlayerStdv1::serializeReconnect( std::ostream& strm, const char* side, const PlayMode& mode ) const { strm << "(reconnect " << side << " " << PlayModeString[ mode ] << ")"; } void SerializerPlayerStdv1::serializeOKClang( std::ostream& strm, int min, int max ) const { strm << "(ok clang (ver " << min << " " << max << "))"; } void SerializerPlayerStdv1::serializeErrorNoTeamName( std::ostream& strm, const std::string& team_name ) const { strm << "(error no team with name " << team_name << ")"; } void SerializerPlayerStdv1::serializeScore( std::ostream& strm, int time, int our, int opp ) const { strm << "(score " << time << " " << our << " " << opp << ")"; } namespace { const SerializerPlayer* create() { return SerializerPlayerStdv1::instance(); } lib::RegHolder v1 = SerializerPlayer::factory().autoReg( &create, 1 ); lib::RegHolder v2 = SerializerPlayer::factory().autoReg( &create, 2 ); lib::RegHolder v3 = SerializerPlayer::factory().autoReg( &create, 3 ); lib::RegHolder v4 = SerializerPlayer::factory().autoReg( &create, 4 ); lib::RegHolder v5 = SerializerPlayer::factory().autoReg( &create, 5 ); lib::RegHolder v6 = SerializerPlayer::factory().autoReg( &create, 6 ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -