Skip to content

Instantly share code, notes, and snippets.

@pmiddend
Created December 30, 2015 13:46
Show Gist options
  • Select an option

  • Save pmiddend/c2f3abc8b096692ac11b to your computer and use it in GitHub Desktop.

Select an option

Save pmiddend/c2f3abc8b096692ac11b to your computer and use it in GitHub Desktop.
fcppt::optional<level_actor>
load_actor(std::istream &s)
{
return
fcppt::optional_apply(
[](level_actor::id_type const _id,level_actor::pos_type const _pos_x,level_actor::pos_type const _pos_y) { return level_actor(_id,_pos_x,_pos_y); }),
fcppt::io::read<level_actor::id_type>(s,fcppt::endianness::format::little),
fcppt::io::read<level_actor::pos_type>(s,fcppt::endianness::format::little),
fcppt::io::read<level_actor::pos_type>(s,fcppt::endianness::format::little));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment