serializercoachstdv7.cpp
来自「2009 ROBOCUP 仿真2DSERVER 源码」· C++ 代码 · 共 156 行
CPP
156 行
// -*-c++-*-/*************************************************************************** serializercoachstdv7.cc Class for serializing data to std v7 offline coaches ------------------- begin : 27-MAY-2002 copyright : (C) 2002 by The RoboCup Soccer Server Maintenance Group. email : sserver-admin@lists.sourceforge.net***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU LGPL as published by the Free Software * * Foundation; either version 2 of the License, or (at your option) any * * later version. * * * ***************************************************************************/#include "serializercoachstdv7.h"#include "clangmsg.h"#include "object.h"namespace rcss {SerializerCoachStdv7::SerializerCoachStdv7( const SerializerCommon & common ) : SerializerCoachStdv1( common ){}SerializerCoachStdv7::~SerializerCoachStdv7(){}constSerializerCoachStdv7 *SerializerCoachStdv7::instance(){ rcss::SerializerCommon::Creator cre; if ( ! rcss::SerializerCommon::factory().getCreator( cre, 7 ) ) { return NULL; } static SerializerCoachStdv7 ser( cre() ); return &ser;}voidSerializerCoachStdv7::serializeCoachAudio( std::ostream & strm, const int time, const std::string & name, const char * msg ) const{ strm << "(hear " << time << ' ' << name << " \"" << msg << "\")";}voidSerializerCoachStdv7::serializeCoachStdAudio( std::ostream & strm, const int time, const std::string & name, const rcss::clang::Msg & msg ) const{ strm << "(hear " << time << ' ' << name << " \"" << msg << "\")";}voidSerializerCoachStdv7::serializePlayerAudio( std::ostream & strm, const int time, const std::string & name, const char * msg ) const{ strm << "(hear " << time << ' ' << name << " \"" << msg << "\")";}voidSerializerCoachStdv7::serializeVisualBegin( std::ostream & strm, const int time ) const{ strm << "(see_global " << time;}voidSerializerCoachStdv7::serializeVisualObject( std::ostream & strm, const std::string & name, const PVector & pos, const PVector & vel, const int body, const int neck ) const{ strm << " (" << name << ' ' << pos.x << ' ' << pos.y << ' ' << vel.x << ' ' << vel.y << ' ' << body << ' ' << neck << ')';}voidSerializerCoachStdv7::serializeVisualPlayer( std::ostream & strm, const Player & /*player*/ , const std::string & name, const PVector & pos, const PVector & vel, const int body, const int neck ) const{ strm << " (" << name << ' ' << pos.x << ' ' << pos.y << ' ' << vel.x << ' ' << vel.y << ' ' << body << ' ' << neck << ')';}voidSerializerCoachStdv7::serializeVisualPlayer( std::ostream & strm, const Player & /*player*/ , const std::string & name, const PVector & pos, const PVector & vel, const int body, const int neck, const int /*point_dir*/ ) const{ strm << " (" << name << ' ' << pos.x << ' ' << pos.y << ' ' << vel.x << ' ' << vel.y << ' ' << body << ' ' << neck << ')';}namespace {constSerializerCoach *create(){ return SerializerCoachStdv7::instance();}RegHolder v7 = SerializerCoach::factory().autoReg( &create, 7 );}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?