mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 09:02:30 +00:00
Added wb::side_actions::make_net_cmd_refresh().
This commit is contained in:
parent
a45aab728f
commit
1155b3c65b
@ -669,6 +669,12 @@ void side_actions::execute_net_cmd(net_cmd const& cmd)
|
||||
{
|
||||
safe_clear();
|
||||
}
|
||||
else if(type=="refresh")
|
||||
{
|
||||
safe_clear();
|
||||
foreach(net_cmd const& sub_cmd, cmd.child_range("net_cmd"))
|
||||
execute_net_cmd(sub_cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR_WB << "side_actions::execute_network_command(): received invalid type!\n";
|
||||
@ -714,5 +720,16 @@ side_actions::net_cmd side_actions::make_net_cmd_clear() const
|
||||
result["type"] = "clear";
|
||||
return result;
|
||||
}
|
||||
side_actions::net_cmd side_actions::make_net_cmd_refresh() const
|
||||
{
|
||||
net_cmd result;
|
||||
result["type"] = "refresh";
|
||||
|
||||
const_iterator end = this->end();
|
||||
for(const_iterator itor=begin(); itor!=end; ++itor)
|
||||
result.add_child("net_cmd",make_net_cmd_insert(itor,*itor));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} //end namespace wb
|
||||
|
@ -225,6 +225,7 @@ public:
|
||||
net_cmd make_net_cmd_remove(const_iterator const& pos) const;
|
||||
net_cmd make_net_cmd_bump_later(const_iterator const& pos) const;
|
||||
net_cmd make_net_cmd_clear() const;
|
||||
net_cmd make_net_cmd_refresh() const;
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user