]> git.saurik.com Git - wxWidgets.git/blob - demos/life/reader.h
(should) fix unix compilation...
[wxWidgets.git] / demos / life / reader.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: reader.h
3 // Purpose: Life! pattern reader (writer coming soon)
4 // Author: Guillermo Rodriguez Garcia, <guille@iies.es>
5 // Modified by:
6 // Created: Jan/2000
7 // RCS-ID: $Id$
8 // Copyright: (c) 2000, Guillermo Rodriguez Garcia
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _LIFE_READER_H_
13 #define _LIFE_READER_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "reader.h"
17 #endif
18
19 // for compilers that support precompilation, includes "wx/wx.h"
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 // for all others, include the necessary headers
27 #ifndef WX_PRECOMP
28 #include "wx/wx.h"
29 #endif
30
31 #include "game.h"
32
33 // --------------------------------------------------------------------------
34 // LifeReader
35 // --------------------------------------------------------------------------
36
37 class LifeReader
38 {
39 public:
40 LifeReader(wxInputStream& is);
41
42 inline bool IsOk() const { return m_ok; };
43 inline wxString GetDescription() const { return m_description; };
44 inline wxString GetRules() const { return m_rules; };
45 inline wxArrayString GetShape() const { return m_shape; };
46 inline LifePattern GetPattern() const
47 {
48 return LifePattern(_(""), m_description, m_rules, m_shape);
49 };
50
51 private:
52 bool m_ok;
53 wxString m_description;
54 wxString m_rules;
55 wxArrayString m_shape;
56 };
57
58 #endif // _LIFE_READER_H_