Skip to content

Instantly share code, notes, and snippets.

@ChunChunMorning
Last active December 11, 2015 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChunChunMorning/6e5c5b8fe7ea05cca0a9 to your computer and use it in GitHub Desktop.
Save ChunChunMorning/6e5c5b8fe7ea05cca0a9 to your computer and use it in GitHub Desktop.
Siv3Dの機能をフル活用してセーブデータを実装する No1
std::unordered_map<String, String> m_data;
template<typename Type> void add(const String& key, const Type& value)
{
m_data[key] = Format(value);
}
template<typename Type> Optional<Type> getOpt(String key) const
{
if (hasKey(key))
{
return ParseOpt<Type>(m_data.at(key));
}
return none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment