00001 /* QuestDesigner - Open Zelda's Project 00002 Copyright (C) 2003 Kronuz 00003 Copyright (C) 2001/2003 Open Zelda's Project 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00020 00054 #pragma once 00055 00056 #include "FileManager.h" 00057 00059 // Forward declarations 00060 class CSpriteSheet; 00061 class CAnimation; 00062 00064 00074 class IDrawableObject 00075 { 00076 public: 00084 virtual bool Draw() = 0; 00085 00090 virtual bool NeedToDraw() = 0; 00091 }; 00092 00094 00104 class IScriptableObject 00105 { 00106 public: 00113 virtual bool ExecuteScript(CString sCommand); 00114 }; 00115 00117 00135 class CSprite : 00136 public IIOObject 00137 { 00138 protected: 00139 CIOMode *m_InOut; 00140 bool Load(CString &sFile) { return false; } 00141 bool Save(CString &sFile) { return false; } 00142 00156 enum _spt_type { 00157 tBackground, 00158 tEntity, 00159 tMask 00160 } m_SptType; 00172 CSpriteSheet *m_pSpriteSheet; 00178 CString m_sSpriteName; 00184 CRect m_rcBoundaries; 00190 }; 00191 00193 00207 class CMaskMap : 00208 public CSprite 00209 { 00210 }; 00211 00213 00225 class CBackground : 00226 public IDrawableObject, 00227 public CSprite 00228 { 00229 protected: 00230 CAnimation *m_pAnimation; 00235 UCHAR m_cAlphaValue; 00241 CString m_sSubLayer; 00251 }; 00252 00254 00268 class CEntity : 00269 public IScriptableObject, 00270 public CBackground 00271 { 00272 protected: 00273 CString m_sEntityScript; 00281 }; 00282 00284 00299 class CAnimation 00300 { 00301 protected: 00302 CSpriteSheet *m_pSpriteSheet; 00308 CSimpleArray<CBackground*> m_Sprites; 00309 int m_iSpeed; 00310 }; 00311 00313 00327 class CSpriteSheet : 00328 public IIOObject 00329 { 00330 protected: 00331 CIOMode *m_InOut; 00332 bool Load(CString &sFile) { return false; } 00333 bool Save(CString &sFile) { return false; } 00334 00335 CString m_sRelativePath; 00336 CString m_Filename; 00337 00338 CString m_sSheetName; 00339 CSimpleArray<CSprite> m_Sprites; 00340 CSimpleArray<CAnimation> m_Animations; 00341 };