ScummVM API documentation
evilfish.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  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, this code is also
23  * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24  * full text of the license.
25  *
26  */
27 
28 #ifndef GOB_MINIGAMES_GEISHA_EVILFISH_H
29 #define GOB_MINIGAMES_GEISHA_EVILFISH_H
30 
31 #include "gob/aniobject.h"
32 
33 namespace Gob {
34 
35 namespace Geisha {
36 
38 class EvilFish : public ANIObject {
39 public:
40  enum Direction {
41  kDirectionLeft = 0,
42  kDirectionRight = 1
43  };
44 
45  EvilFish(const ANIFile &ani, uint16 screenWidth,
46  uint16 animSwimLeft, uint16 animSwimRight,
47  uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie);
48  ~EvilFish() override;
49 
51  void enter(Direction from, int16 y);
53  void leave();
54 
56  void die();
57 
59  void advance() override;
60 
62  void mutate(uint16 animSwimLeft, uint16 animSwimRight,
63  uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie);
64 
66  bool isDead() const;
67 
68 private:
69  enum State {
70  kStateNone,
71  kStateSwimLeft,
72  kStateSwimRight,
73  kStateTurnLeft,
74  kStateTurnRight,
75  kStateDie
76  };
77 
78  uint16 _screenWidth;
79 
80  uint16 _animSwimLeft;
81  uint16 _animSwimRight;
82  uint16 _animTurnLeft;
83  uint16 _animTurnRight;
84  uint16 _animDie;
85 
86  bool _shouldLeave;
87 
88  State _state;
89 };
90 
91 } // End of namespace Geisha
92 
93 } // End of namespace Gob
94 
95 #endif // GOB_MINIGAMES_GEISHA_EVILFISH_H
void advance() override
Definition: aniobject.h:42
void mutate(uint16 animSwimLeft, uint16 animSwimRight, uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie)
Definition: evilfish.h:38
Definition: anifile.h:40
void enter(Direction from, int16 y)
Definition: anifile.h:53