1 // -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 // vi:tw=80:et:ts=2:sts=2 3 // 4 // ----------------------------------------------------------------------- 5 // 6 // This file is part of RLVM, a RealLive virtual machine clone. 7 // 8 // ----------------------------------------------------------------------- 9 // 10 // Copyright (C) 2007 Elliot Glaysher 11 // 12 // This program is free software; you can redistribute it and/or modify 13 // it under the terms of the GNU General Public License as published by 14 // the Free Software Foundation; either version 3 of the License, or 15 // (at your option) any later version. 16 // 17 // This program is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 // GNU General Public License for more details. 21 // 22 // You should have received a copy of the GNU General Public License 23 // along with this program; if not, write to the Free Software 24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 25 // 26 // ----------------------------------------------------------------------- 27 28 #ifndef SRC_MACHINE_SAVE_GAME_HEADER_H_ 29 #define SRC_MACHINE_SAVE_GAME_HEADER_H_ 30 31 #include <boost/date_time/posix_time/posix_time_types.hpp> 32 #include <string> 33 34 // Header structure written to and read from the start of each save 35 // game file. This structure is at the top of the file since it is 36 // what gets queried by SaveDate, SaveTime, etc. 37 struct SaveGameHeader { 38 SaveGameHeader(); 39 explicit SaveGameHeader(const std::string& in_title); 40 ~SaveGameHeader(); 41 42 // The title of the current saved game 43 std::string title; 44 45 // The time the save file was created. 46 boost::posix_time::ptime save_time; 47 48 // boost::serialization support 49 template <class Archive> serializeSaveGameHeader50 void serialize(Archive& ar, unsigned int version) { 51 ar& title& save_time; 52 } 53 }; 54 55 #endif // SRC_MACHINE_SAVE_GAME_HEADER_H_ 56