source: abuse/branches/lol/src/property.h @ 714

Last change on this file since 714 was 714, checked in by Sam Hocevar, 9 years ago

core: refactor property manager /* FIXME: this is putrid. */

  • Property svn:keywords set to Id
File size: 983 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#ifndef __PROPERTY_HPP_
12#define __PROPERTY_HPP_
13
14class AProperty;
15
16class APropertyManager
17{
18public:
19    APropertyManager();
20    ~APropertyManager();
21
22    void load(char const *filename);
23    void save(char const *filename);
24
25    int getd(char const *name, int def) { return (int)get(name, def); }
26    int get(char const *name, int def);
27    char const *get(char const *name, char const *def);
28
29    void setd(char const *name, int def) { set(name,def); }
30    void set(char const *name, double def);
31    void set(char const *name, char const *def);
32
33private:
34    Array<AProperty *> m_props;
35
36    AProperty *find(char const *name);
37};
38
39#endif
40
Note: See TracBrowser for help on using the repository browser.