本文整理汇总了C++中CL_NetGameEvent::get_argument方法的典型用法代码示例。如果您正苦于以下问题:C++ CL_NetGameEvent::get_argument方法的具体用法?C++ CL_NetGameEvent::get_argument怎么用?C++ CL_NetGameEvent::get_argument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CL_NetGameEvent
的用法示例。
在下文中一共展示了CL_NetGameEvent::get_argument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_event_game_over
void GameEvents::on_event_game_over(const CL_NetGameEvent &e)
{
CL_String title = e.get_argument(0);
CL_String message = e.get_argument(1);
client->get_game_view()->game_over(title, message);
}
示例2: on_evento_juego_otorga_powerup
void Cliente::on_evento_juego_otorga_powerup(const CL_NetGameEvent &e)
{
int id_tanque = e.get_argument(0);
int id_power = e.get_argument(1);
mundo->otorgaPowerup(id_tanque, id_power);
}
示例3: on_event_attack_area
void ServerGameEvents::on_event_attack_area(const CL_NetGameEvent &e, ServerGame *game, ServerGamePlayer *game_player)
{
int map_area_from_id = e.get_argument(0);
int map_area_to_id = e.get_argument(1);
game->attack_area(game_player, map_area_from_id, map_area_to_id);
}
示例4: on_event_game_loadmap
// "Game-LoadMap" event was received
void Client::on_event_game_loadmap(const CL_NetGameEvent &e)
{
CL_String map_name = e.get_argument(0);
int max_players = e.get_argument(1);
CustomType position = e.get_argument(2);
cl_log_event("events", "Loading map: %1 with %2 players, Position %3,%4,%5", map_name, max_players, position.get_x(), position.get_y(), position.get_z());
}
示例5: on_evento_juego_actualizar_SubID
void Cliente::on_evento_juego_actualizar_SubID(const CL_NetGameEvent &e)
{
cl_log_event("eventos", "Actualiza SubID");
int contSubID = e.get_argument(0);
int tanqueid = e.get_argument(1);
mundo->setSubID(contSubID);
mundo->getTanqueID(tanqueid)->disparar();
}
示例6: on_evento_login
//Evento Login: Recibido
void Servidor::on_evento_login(const CL_NetGameEvent &e, UsuarioServidor *usuario)
{
cl_log_event("eventos", "Cliente solicita login");
int numusuarios = Usuarios.size();
/*
if(numusuarios < (numjugadores -1) )
{
CL_String idlogin = e.get_argument(0);
CL_String password = e.get_argument(1);
CL_String nombre_usuario = e.get_argument(2);
CL_SqliteConnection bd_conexion("bdjuego.sql3");
CL_DBCommand consulta_login = bd_conexion.create_command("SELECT password FROM Usuarios WHERE id=?1");
consulta_login.set_input_parameter_string(1,idlogin);
CL_DBReader reader = bd_conexion.execute_reader(consulta_login);
CL_String pas_bd;
if(reader.retrieve_row())
{
pas_bd = reader.get_column_string(0);
if(password.compare(pas_bd)==0) //Password Correcto
{
usuario->nombre_usuario= nombre_usuario;
usuario->id = siguiente_usuario_id++;
Usuarios.push_back(usuario);
usuario->enviar_evento(CL_NetGameEvent("Login-Completado"));
}
else //Clave Incorrecta
{
usuario->enviar_evento(CL_NetGameEvent("Login-Fallado", "Clave Incorrecta"));
}
}
else
{
usuario->enviar_evento(CL_NetGameEvent("Login-Fallado", "ID No encontrado")); //ID Incorrecto
}
reader.close();
}
else
{
usuario->enviar_evento(CL_NetGameEvent("Login-ServidorLleno"));
}
*/
CL_String idlogin = e.get_argument(0);
CL_String password = e.get_argument(1);
CL_String nombre_usuario = e.get_argument(2);
usuario->nombre_usuario= nombre_usuario;
usuario->id = siguiente_usuario_id++;
Usuarios.push_back(usuario);
usuario->enviar_evento(CL_NetGameEvent("Login-Completado"));
}
示例7: on_evento_juego_agrega_powerup
void Cliente::on_evento_juego_agrega_powerup(const CL_NetGameEvent &e)
{
int i = e.get_argument(0);
float x = e.get_argument(1);
float y = e.get_argument(2);
PowerupTipo tipos[4] = {MEDIKIT,ESCUDO,RAPIDEZ_TANQUE,DISPARO_360};
mundo->agregarPowerup(tipos[i], CL_Vec2f(x, y));
}
示例8: on_evento_juego_matar_tanque
void Cliente::on_evento_juego_matar_tanque(const CL_NetGameEvent &e)
{
cl_log_event("eventos", "Matar Tanque");
int idtanque = e.get_argument(0);
int tiempofin = e.get_argument(1);
mundo->getTanqueID(idtanque)->Matar(CL_System::get_time(), tiempofin);
}
示例9: on_event_player_logged_in
void LobbyEvents::on_event_player_logged_in(const CL_NetGameEvent &e)
{
int player_id = e.get_argument(0);
CL_String player_name = e.get_argument(1);
LobbyPlayer *player = player_collection->create_player(player_id, player_name);
if (client->get_lobby_view())
client->get_lobby_view()->player_logged_in(player);
}
示例10: on_event_player_message
void LobbyEvents::on_event_player_message(const CL_NetGameEvent &e)
{
int player_id = e.get_argument(0);
CL_String message = e.get_argument(1);
LobbyPlayer *player = player_collection->get_player(player_id);
if(client->get_lobby_view() && player)
client->get_lobby_view()->add_chat_message(player, message);
}
示例11: parseEvent
void RaceStart::parseEvent(const CL_NetGameEvent &p_event)
{
assert(p_event.get_name() == EVENT_RACE_START);
int i = 0;
m_carPosition.x = static_cast<float> (p_event.get_argument(i++));
m_carPosition.y = static_cast<float> (p_event.get_argument(i++));
m_carRotation.set_radians(static_cast<float> (p_event.get_argument(i++)));
}
示例12: on_event_game_player_message
void GameEvents::on_event_game_player_message(const CL_NetGameEvent &e)
{
int player_id = e.get_argument(0);
CL_String message = e.get_argument(1);
GamePlayer *player = client->get_game_model()->get_players()->get_player(player_id);
if(player)
{
client->get_game_view()->add_player_message(player, message);
}
}
示例13: on_event_set_maparea_army_strength
void GameEvents::on_event_set_maparea_army_strength(const CL_NetGameEvent &e)
{
int map_area_id = e.get_argument(0);
int army_strength = e.get_argument(1);
MapArea *map_area = client->get_game_model()->get_map()->get_area_by_id(map_area_id);
if(map_area != 0 && army_strength >= 1 && army_strength <= 8)
map_area->army_strength = army_strength;
else
cl_log_event("error", "Invalid event: %1", e.to_string());
}
示例14: on_event_player_joined_game
void GameEvents::on_event_player_joined_game(const CL_NetGameEvent &e)
{
int player_id = e.get_argument(0);
CL_String player_name = e.get_argument(1);
int visual_id = e.get_argument(2);
GamePlayer *player = client->get_game_model()->get_players()->create_player(player_name, player_id, visual_id);
if(player)
client->get_game_view()->player_joined_game(player);
else
cl_log_event("error", "Invalid event: %1", e.to_string());
}
示例15: parseEvent
void CarState::parseEvent(const CL_NetGameEvent &p_event)
{
assert(p_event.get_name() == EVENT_CAR_STATE);
m_name = p_event.get_argument(0);
m_serialData = CL_NetGameEvent("");
const int argCount = static_cast<signed>(p_event.get_argument_count());
for (int i = 1; i < argCount; ++i) {
m_serialData.add_argument(p_event.get_argument(i));
}
}