5 * Created by Alyssa Milburn on Tue May 25 2004.
6 * Copyright (c) 2004 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #ifndef _COMPOUNDAGENT_H
21 #define _COMPOUNDAGENT_H
26 #include "CompoundPart.h"
27 #include "endianlove.h"
30 int left
, top
, right
, bottom
;
33 struct HotspotFunction
{
39 class CompoundAgent
: public Agent
{
41 std::vector
<CompoundPart
*> parts
;
45 HotspotFunction hotspotfunctions
[6];
46 std::string spritefile
;
47 unsigned int firstimage
, imagecount
;
50 CompoundAgent(unsigned char family
, unsigned char genus
, unsigned short species
, unsigned int plane
,
51 std::string spritefile
, unsigned int firstimage
, unsigned int imagecount
);
52 CompoundAgent(std::string spritefile
, unsigned int firstimage
, unsigned int imagecount
); // C1/C2 constructor
53 virtual ~CompoundAgent();
55 unsigned int partCount() { return parts
.size(); }
56 CompoundPart
*part(unsigned int id
);
57 virtual void addPart(CompoundPart
*);
58 void delPart(unsigned int);
60 void setZOrder(unsigned int plane
);
62 int handleClick(float, float);
63 bool fireScript(unsigned short event
, Agent
*from
, caosVar one
, caosVar two
);
64 void setHotspotLoc(unsigned int id
, int l
, int t
, int r
, int b
);
65 void setHotspotFunc(unsigned int id
, unsigned int h
);
66 void setHotspotFuncDetails(unsigned int id
, uint16 message
, uint8 flags
);
68 // accessor functions for NEW: PART and similar
69 std::string
getSpriteFile() { return spritefile
; }
70 unsigned int getFirstImage() { return firstimage
; }
71 unsigned int getImageCount() { return imagecount
; }