ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

savestate.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef ENGINES_SAVESTATE_H
00024 #define ENGINES_SAVESTATE_H
00025 
00026 #include "common/array.h"
00027 #include "common/str.h"
00028 #include "common/ptr.h"
00029 
00030 namespace Graphics {
00031 struct Surface;
00032 }
00033 
00045 class SaveStateDescriptor {
00046 public:
00047     SaveStateDescriptor();
00048     SaveStateDescriptor(int s, const Common::String &d);
00049 
00053     void setSaveSlot(int slot) { _slot = slot; }
00054 
00058     int getSaveSlot() const { return _slot; }
00059 
00063     void setDescription(const Common::String &desc) { _description = desc; }
00064 
00068     const Common::String &getDescription() const { return _description; }
00069 
00075     void setDeletableFlag(bool state) { _isDeletable = state; }
00076 
00080     bool getDeletableFlag() const { return _isDeletable; }
00081 
00085     void setWriteProtectedFlag(bool state) { _isWriteProtected = state; }
00086 
00090     bool getWriteProtectedFlag() const { return _isWriteProtected; }
00091 
00095     void setLocked(bool state) {
00096         _isLocked = state;
00097 
00098         //just in case:
00099         if (state) {
00100             setDeletableFlag(false);
00101             setWriteProtectedFlag(true);
00102         }
00103     }
00104 
00108     bool getLocked() const { return _isLocked; }
00109 
00116     const Graphics::Surface *getThumbnail() const { return _thumbnail.get(); }
00117 
00123     void setThumbnail(Graphics::Surface *t);
00124     void setThumbnail(Common::SharedPtr<Graphics::Surface> t) { _thumbnail = t; }
00125 
00133     void setSaveDate(int year, int month, int day);
00134 
00140     const Common::String &getSaveDate() const { return _saveDate; }
00141 
00148     void setSaveTime(int hour, int min);
00149 
00155     const Common::String &getSaveTime() const { return _saveTime; }
00156 
00163     void setPlayTime(int hours, int minutes);
00164 
00170     void setPlayTime(uint32 msecs);
00171 
00178     const Common::String &getPlayTime() const { return _playTime; }
00179 
00186     uint32 getPlayTimeMSecs() const { return _playTimeMSecs; }
00187 
00188 private:
00192     int _slot;
00193 
00197     Common::String _description;
00198 
00202     bool _isDeletable;
00203 
00207     bool _isWriteProtected;
00208 
00212     bool _isLocked;
00213 
00217     Common::String _saveDate;
00218 
00222     Common::String _saveTime;
00223 
00228     Common::String _playTime;
00229 
00234     uint32 _playTimeMSecs;
00235 
00239     Common::SharedPtr<Graphics::Surface> _thumbnail;
00240 };
00241 
00243 typedef Common::Array<SaveStateDescriptor> SaveStateList;
00244 
00248 struct SaveStateDescriptorSlotComparator {
00249     bool operator()(const SaveStateDescriptor &x, const SaveStateDescriptor &y) const {
00250         return x.getSaveSlot() < y.getSaveSlot();
00251     }
00252 };
00253 
00254 #endif


Generated on Sat May 25 2019 05:00:53 for ResidualVM by doxygen 1.7.1
curved edge   curved edge