~fedevera/pictogame/Pictogame

« back to all changes in this revision

Viewing changes to picto/utils/Saver.java

  • Committer: Federico Vera
  • Date: 2011-11-20 21:23:28 UTC
  • Revision ID: dktcoding@gmail.com-20111120212328-eqbxb8kth9hxs3zw
FirstĀ codeĀ upload

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *                      ..::PictoGame::..
 
3
 *
 
4
 * Copyright (C) Federico Vera 2010-2011 <dktcoding [at] gmail>
 
5
 *
 
6
 * PictoGame is free software: you can redistribute it and/or modify it
 
7
 * under the terms of the GNU General Public License as published by the
 
8
 * Free Software Foundation, either version 3 of the License, or any later
 
9
 * version.
 
10
 *
 
11
 * PictoGame is distributed in the hope that it will be useful, but
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 * See the GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
package picto.utils;
 
21
 
 
22
import java.io.Serializable;
 
23
 
 
24
/**
 
25
 * The 'Saver' object is the object that contains all the necessary info
 
26
 * to recreate a saved instance of a game.
 
27
 *
 
28
 * @author Fido <dktcoding [at] gmail>
 
29
 */
 
30
public class Saver implements Serializable {
 
31
    private static final long serialVersionUID = 765238948376589461L;
 
32
    private PhraseScrambler ps;
 
33
    private byte[] stats;
 
34
    private Picto pic;
 
35
 
 
36
    public Picto getPic() {
 
37
        if (pic != null){
 
38
            pic.regenerate();
 
39
        }
 
40
        return pic;
 
41
    }
 
42
 
 
43
    public void setPic(Picto pic) {
 
44
        this.pic = pic;
 
45
    }
 
46
 
 
47
    public byte[] getStats() {
 
48
        return stats;
 
49
    }
 
50
 
 
51
    public void setStats(byte[] stats) {
 
52
        this.stats = stats;
 
53
    }
 
54
 
 
55
    public PhraseScrambler getPs() {
 
56
        if (ps != null){
 
57
            ps.getPic();
 
58
        }
 
59
        return ps;
 
60
    }
 
61
 
 
62
    public void setPs(PhraseScrambler ps) {
 
63
        this.ps = ps;
 
64
    }
 
65
}