merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / inv / monst.hxx
blob0cf3788f880689730cb0982d5efcd033cf4ddf5a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: monst.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _MONST_HXX
31 #define _MONST_HXX
33 enum GegnerType { GEGNER1, GEGNER2, GEGNER3, GEGNER4, GEGNER5 };
34 enum GegnerMode { MOVE1, MOVE2, MOVE3, MOVE4, MOVE5, DELETED, HIDE };
36 #define DIFFX 20
37 #define DIFFY 20
38 #define MOVEX 10
39 #define MOVEY 10
40 #define KOLLXY 2
42 #include <tools/list.hxx>
43 #include <vcl/image.hxx>
44 #include <tools/gen.hxx>
45 #include <vcl/outdev.hxx>
47 struct Gegner_Impl
49 Point aXY;
50 long nRow;
51 long aX;
52 long nDiffX;
53 long nPoints;
54 long nMaxHits;
55 long nHits;
56 long nDelay;
57 GegnerType aType;
58 GegnerMode aMode;
59 Rectangle aKoll;
62 DECLARE_LIST(GegnerListe,Gegner_Impl*)
64 class Explosion;
65 class Bombe;
66 class Fighter;
68 class Gegner : public GegnerListe
70 private:
71 long nRows;
72 long nGegnerRow;
73 long nMaxX;
74 Size aOutSize;
75 Image* pBitMonst1;
76 Image* pBitMonst2;
77 Image* pBitMonst3;
78 Image* pBitMonst4;
79 Image* pBitMonst1b;
80 Image* pBitMonst2b;
81 Image* pBitMonst3b;
82 Image* pBitMonst4b;
83 Image* pBitMonst5;
84 Image* pBitMonst5a;
85 Image* pBitMonst5b;
86 Bombe* pBombe;
87 Fighter* pFighter;
89 BOOL bDown;
90 BOOL bLeft;
91 BOOL bAuseMode;
92 long nRandWert;
93 long nDown;
95 public:
96 Gegner(Fighter* pFighter, Bombe* pBombe, ResMgr* pRes);
97 ~Gegner();
99 void InsertGegner(long nType, long x, long y);
100 void DrawGegner(OutputDevice* pDev, Point* pStart);
101 void Move();
102 void SetRandWert(long nWert) { nRandWert = nWert; }
103 long GetRandWert() { return nRandWert; }
104 long GegnerX(long nWert) { return GetObject(nWert)->aXY.X(); }
105 long GegnerXStart(long nWert) { return GetObject(nWert)->aX; }
106 long GegnerY(long nWert) { return GetObject(nWert)->aXY.Y(); }
107 GegnerType GegType(long nWert)
108 { return GetObject(nWert)->aType; }
109 GegnerMode GegMode(long nWert)
110 { return GetObject(nWert)->aMode; }
111 void SetMode(long nWert, enum GegnerMode nMode)
112 { GetObject(nWert)->aMode = nMode; }
113 void SetGegnerPos(long nWert, const Point& rPoint)
114 { GetObject(nWert)->aXY = rPoint;}
115 long GegnerDiffX(long nWert) { return GetObject(nWert)->nDiffX; }
116 Rectangle& GegnerKoll(long nWert) { return GetObject(nWert)->aKoll; }
117 Rectangle GetKoll(long nWert);
118 void SetKoll(long nWert, const Rectangle& rRect)
119 { GetObject(nWert)->aKoll = rRect; }
120 long Kollision(Rectangle& rRect, Explosion* pExplosion);
121 Point& GegnerPos(long nWert) { return GetObject(nWert)->aXY; }
122 BOOL RemoveGegner();
123 void ClearAll();
124 long GegnerPoints(long nWert) { return GetObject(nWert)->nPoints; }
125 void GegnerHit(long nWert) { GetObject(nWert)->nHits++; }
126 BOOL GegnerDest(long nWert);
127 void SetDown(long nWert) { nDown = nWert; }
128 long GetDown() { return nDown; }
129 void SetAuseMode(BOOL bFlag) { bAuseMode = bFlag; }
130 void SetDelay(long nWert) { GetObject(nWert)->nDelay = 3; }
131 long GetDelay(long nWert) { return GetObject(nWert)->nDelay; }
132 void DecDelay(long nWert) { GetObject(nWert)->nDelay--; }
135 #endif