ScummVM API documentation
fight.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef LASTEXPRESS_FIGHT_H
23 #define LASTEXPRESS_FIGHT_H
24 
25 #include "lastexpress/lastexpress.h"
26 
27 namespace LastExpress {
28 
29 class LastExpressEngine;
30 class CFighter;
31 
32 struct Seq;
33 struct Event;
34 
35 class CFight {
36 public:
37  CFight(LastExpressEngine *engine, int fightId);
38  ~CFight();
39 
40  int process();
41  void setOutcome(int outcome);
42  void endFight(int outcome);
43  void timer(Event *event, bool isProcessing);
44  void mouse(Event *event);
45 
46  void setFightHappening(bool happening) { _fightIsHappening = happening; }
47  bool fightHappening() { return _fightIsHappening; }
48 
49 private:
50  LastExpressEngine *_engine = nullptr;
51 
52  CFighter *_cath = nullptr;
53  CFighter *_opponent = nullptr;
54  int _outcome = 0;
55  int _currentSeqIdx = 0;
56  Common::String _seqNames[20];
57  bool _fightIsHappening = false;
58 
59  void (LastExpressEngine::*_savedTimerEventHandle)(Event *) = nullptr;
60  void (LastExpressEngine::*_savedMouseEventHandle)(Event *) = nullptr;
61 
62  bool _lowIconToggle = false;
63  int _eggIconBrightness = 0;
64  int _eggIconBrightnessStep = 1;
65 };
66 
67 } // End of namespace LastExpress
68 
69 #endif // LASTEXPRESS_FIGHT_H
Definition: str.h:59
Definition: lastexpress.h:523
Definition: archive.h:29
Definition: fighter.h:35
Definition: events.h:62
Definition: fight.h:35