diff options
author | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 09:42:58 +0000 |
---|---|---|
committer | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 09:42:58 +0000 |
commit | 7a5387cbd6aa4682c7f2845bde065a9e0b828e23 (patch) | |
tree | 995b883e6d67e8c9011bb02133b83ce65dcfa47a /crawl-ref/source/notes.h | |
parent | 922cba628d3d6377574a90c7a817c10d84ed7f85 (diff) | |
download | crawl-ref-7a5387cbd6aa4682c7f2845bde065a9e0b828e23.tar.gz crawl-ref-7a5387cbd6aa4682c7f2845bde065a9e0b828e23.zip |
This was originally going to be a small refactor of stash.cc before
getting into stash/item finding, but it ended up big. Removed the
read/writeThing API in favor of the marshall/unmarshallThing API. It
was slightly awkward in a couple spots where the format of writeThing
and marshallThing differed slightly (strings, level_id, level_pos).
Doesn't affect savegames.
When it's is okay to break savegames (maybe just before releasing
0.4?) it would be nice to remove the few remaining redundancies listed
above.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3828 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/notes.h')
-rw-r--r-- | crawl-ref/source/notes.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crawl-ref/source/notes.h b/crawl-ref/source/notes.h index 8ba835861b..7e8366bb3a 100644 --- a/crawl-ref/source/notes.h +++ b/crawl-ref/source/notes.h @@ -17,6 +17,9 @@ #include <vector> #include <stdio.h> +class reader; +class writer; + enum NOTE_TYPES { NOTE_HP_CHANGE = 0, /* needs: new hp, max hp */ @@ -51,25 +54,26 @@ struct Note Note(); Note( NOTE_TYPES t, int f = 0, int s = 0, const char* n = 0, const char* d = 0); + void save(writer& outf) const; + void load(reader& inf); + std::string describe( bool when = true, bool where = true, + bool what = true ) const; + void check_milestone() const; + NOTE_TYPES type; int first, second; long turn; unsigned short packed_place; std::string name; std::string desc; - void load( FILE* fp ); - void save( FILE* fp ) const; - std::string describe( bool when = true, bool where = true, - bool what = true ) const; - void check_milestone() const; }; extern std::vector<Note> note_list; void activate_notes( bool active ); bool notes_are_active(); void take_note( const Note& note, bool force = false ); -void save_notes( FILE* fp ); -void load_notes( FILE* fp ); +void save_notes(writer&); +void load_notes(reader&); void make_user_note(); #endif |