-
Notifications
You must be signed in to change notification settings - Fork 2
/
gamediff.h
84 lines (67 loc) · 2.15 KB
/
gamediff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* This file is part of the Advance project.
*
* Copyright (C) 2002 Andrea Mazzoleni
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __GAMEDIFF_H
#define __GAMEDIFF_H
#include <set>
#include <list>
#include <vector>
#include <string>
class rom {
std::string name;
unsigned size;
unsigned crc;
public:
rom();
rom(const rom&);
bool operator<(const rom&) const;
bool operator==(const rom&) const;
bool operator!=(const rom& A) const { return !operator==(A); }
const std::string& name_get() const { return name; }
unsigned size_get() const { return size; }
unsigned crc_get() const { return crc; }
void name_set(const std::string& A) { name = A; }
void size_set(unsigned A) { size = A; }
void crc_set(unsigned A) { crc = A; }
};
std::ostream& operator<<(std::ostream &os, const rom&);
typedef std::set<rom> rom_set;
bool include(const rom_set& A, const rom_set& B);
class game {
std::string name;
rom_set roms;
public:
game();
game(const game&);
bool operator<(const game&) const;
const std::string& name_get() const { return name; }
const rom_set& roms_get() const { return roms; }
rom_set& roms_get() { return roms; }
void name_set(const std::string& A) { name = A; }
void roms_set(const rom_set& A) { roms = A; }
};
std::ostream& operator<<(std::ostream &os, const game&);
typedef std::set<game> game_set;
class game_set_load : public game_set {
public:
typedef game_set::const_iterator const_iterator;
typedef game_set::iterator iterator;
bool load(bool remove_merge);
};
#endif