master
ブランチ master
Tetris / include / tetris / sys / save.hh
2.1 KB、50行 生 Blame 履歴
1/**
2Copyright (c) テクニカル諏訪子
3
4Permission is hereby granted to any person obtaining a copy of the software
5Tetris (the "Software") to use, modify, merge, copy, publish, distribute,
6sublicense, and/or sell copies of the Software, subject to the following conditions:
7
8 1. **Origin Attribution**:
9 - You must not misrepresent the origin of the Software; you must not claim
10 you created the original Software.
11 - If the Software is used in a product, you must either:
12 a. Provide clear attribution in the product's documentation, user interface,
13 or other visible areas, **OR**
14 b. Pay the original developers a fee they specify in writing.
15 2. **Usage Restriction**:
16 - The Software, or any derivative works, dependencies, or libraries
17 incorporating it, must not be used for censorship or to suppress freedom of
18 speech, expression, or creativity. Prohibited uses include, but are not
19 limited to:
20 - Censorship of so-called "hate speech", visuals, non-mainstream opinions,
21 ideas, or objective reality.
22 - Tools or systems designed to restrict access to information or
23 artistic works.
24 3. **Notice Preservation**:
25 - This license and the above copyright notice must remain intact in all copies
26 of the source code.
27
28THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
29INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
30PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
31HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
32CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
33OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34*/
35#pragma once
36
37#include <util/types.hh>
38
39namespace tetris::sys {
40 struct SaveData {
41 cstr magic = "SAV";
42 const u8 Version = 1;
43 u32 highScore = 0;
44 u16 mostLines = 0;
45 u16 bestLevel = 0;
46 }; // struct SaveData
47
48 SaveData GetScore();
49 bool SaveScore(u32 score, u16 lines, u16 level);
50} // namespace tetris::sys