void ManageAction::gameStart(Packet * packet) { auto& data = packet->getData(); int id = data[0]; std::string tmpPort(""); std::string mapName(""); for (unsigned int i=2; i<data.size() - 5; ++i) mapName.push_back(data[i]); for (unsigned long i=data.size() - 4; i<data.size(); ++i) { tmpPort += data[i]; } _win.getLevel().setCurrentFocusMap(mapName); _win.getWindowGame()->loadNewGame(mapName); _win.play = true; _win._port = static_cast<int>(std::stoi(tmpPort)); _win._playerId = id; }
bool configureHook() { this->ports()->addPort(portToSplitFrom).doc( "Input for Data to be splitted."); nemo::RealVector initvec(nemo::dim(7), 0.0); dataToBeSplitted = boost::shared_ptr<DERIVED>(new DERIVED(initvec)); dataToBePublished.resize(dims); for (int i = 0; i < dataToBePublished.size(); i++) { boost::shared_ptr<RTT::OutputPort<boost::shared_ptr<DERIVED> > > tmpPort( new RTT::OutputPort<boost::shared_ptr<DERIVED> >( "Splitted_Out_" + boost::lexical_cast<std::string>(i))); tmpPort->setDataSample(dataToBeSplitted); this->ports()->addPort(*tmpPort).doc("Output for splitted Data."); portsToSplitTo.push_back(tmpPort); dataToBePublished[i] = boost::shared_ptr<DERIVED>(new DERIVED(0.0)); } return true; }