1 /* FloboPuyo 2 * Copyright (C) 2004 3 * Florent Boudet <flobo@ios-software.com>, 4 * Jean-Christophe Hoelt <jeko@ios-software.com>, 5 * Guillaume Borios <gyom@ios-software.com> 6 * 7 * iOS Software <http://www.ios-software.com> 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2 12 * of the License, or (at your option) any later version. 13 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * 23 * 24 */ 25 26 #ifndef _ANIMATEDPUYO 27 #define _ANIMATEDPUYO 28 29 #include "SDL_Painter.h" 30 #include "PuyoGame.h" 31 #include "PuyoAnimations.h" 32 #include "IosVector.h" 33 34 class PuyoView; 35 36 class AnimatedPuyo : public PuyoPuyo { 37 public: 38 AnimatedPuyo(PuyoState state, PuyoView *attachedView); 39 virtual ~AnimatedPuyo(); 40 void addAnimation(PuyoAnimation *animation); 41 PuyoAnimation * getCurrentAnimation() const; 42 void removeCurrentAnimation(); 43 void cycleAnimation(); 44 void render(); 45 bool isRenderingAnimation() const; setVisible(bool flag)46 void setVisible(bool flag) { visibilityFlag = flag; } getVisible()47 bool getVisible() const { return visibilityFlag; } getAttachedView()48 PuyoView *getAttachedView() const { return attachedView; } 49 int getScreenCoordinateX() const; 50 int getScreenCoordinateY() const; 51 private: 52 IosVector animationQueue; 53 int puyoEyeState; 54 unsigned int smallTicksCount; 55 bool visibilityFlag; 56 PuyoView *attachedView; 57 }; 58 59 60 class AnimatedPuyoFactory : public PuyoFactory { 61 public: 62 AnimatedPuyoFactory(PuyoView *attachedView); 63 virtual ~AnimatedPuyoFactory(); 64 virtual PuyoPuyo *createPuyo(PuyoState state); 65 virtual void deletePuyo(PuyoPuyo *target); 66 void renderWalhalla(); 67 void cycleWalhalla(); 68 private: 69 IosVector puyoWalhalla; 70 PuyoView *attachedView; 71 }; 72 73 #endif // _ANIMATEDPUYO 74 75