summaryrefslogtreecommitdiffstats
path: root/pokemod/MapEffect.h
blob: 36ef60b8cda7805abfc5068aa451e0b47c07044b (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/////////////////////////////////////////////////////////////////////////////
// Name:        pokemod/MapEffect.h
// Purpose:     Define an effect on a map
// Author:      Ben Boeckel
// Modified by: Ben Boeckel
// Created:     Fri June 1 2007 19:57:47
// Copyright:   ©2007-2008 Ben Boeckel and Nerdy Productions
// Licence:
//    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 3 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, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////

#ifndef __POKEMOD_MAPEFFECT__
#define __POKEMOD_MAPEFFECT__

#include <QString>
#include <QStringList>

#include <Exception.h>
#include <Flag.h>
#include <Point.h>

#include "Object.h"

class Pokemod;

class MapEffect : public Object
{
    public:
        enum Effect
        {
            E_Item = 0,
            E_PC = 1,
            E_StrengthBlock = 2,
            E_Button = 3,
            E_SlotMachine = 4,
            E_CardFlipGame = 5,
            E_End = 6
        };
        static const QStringList MapEffectStr;
        
        enum PC
        {
            PC_Item = 0,
            PC_Pokemon = 1,
            PC_Pokedex = 2,
            PC_HallOfFame = 3,
            PC_All = 4,
            PC_End = 5,
        };
        static const QStringList PCTypeStr;
        
        MapEffect(const Pokemod* par, const int _id);
        MapEffect(const Pokemod* par, const MapEffect& e, const int _id);
        MapEffect(const Pokemod* par, const QString& fname, const int _id = -1);
        
        void load(const QString& fname, const int _id = -1) throw(Exception);
        void save(const QString& map) const throw(Exception);
        
        void setName(const QString& n);
        void setCoordinate(const int x, const int y);
        void setCoordinateX(const int x);
        void setCoordinateY(const int y);
        void setExistFlag(const int f, const int s);
        void setExistFlagFlag(const int f);
        void setExistFlagStatus(const int s);
        void setSkin(const QString& s) throw(Exception);
        void setEffect(const int e) throw(BoundsException);
        void setVal1(const int v1) throw(UnusedException);
        void setVal2(const int v2) throw(Exception);
        void setDirection(const int d) throw(BoundsException);
        void setIsGhost(const bool i);
        void setCanMove(const bool c);
        void setDialog(const int d) throw(BoundsException);
        
        QString getName() const;
        Point getCoordinate() const;
        Flag getExistFlag() const;
        QString getSkin() const;
        int getEffect() const;
        int getVal1() const;
        int getVal2() const;
        int getDirection() const;
        bool getIsGhost() const;
        bool getCanMove() const;
        int getDialog() const;
        
        MapEffect& operator=(const MapEffect& rhs);
    private:
        bool validate() const;
        
        QString name;
        Point coordinate;
        Flag existFlag;
        QString skin;
        int effect;
        int val1;
        int val2;
        int direction;
        bool isGhost;
        bool canMove;
        int dialog;
};

#endif