check activateable() before allowing clicks (oops)
[openc2e.git] / Vehicle.h
bloba8cb2d5323ebfe1e7a2b9f21f0e5f9321295b9b2
1 /*
2 * Vehicle.h
3 * openc2e
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 __VEHICLE_H
21 #define __VEHICLE_H
23 #include "CompoundAgent.h"
24 #include "openc2e.h"
26 class Vehicle : public CompoundAgent {
27 protected:
28 friend class SFCVehicle;
30 unsigned int capacity;
31 unsigned int bump;
33 public:
34 Vehicle(unsigned int family, unsigned int genus, unsigned int species, unsigned int plane,
35 std::string spritefile, unsigned int firstimage, unsigned int imagecount);
36 Vehicle(std::string spritefile, unsigned int firstimage, unsigned int imagecount); // C1/C2 constructor
38 caosVar xvec, yvec;
39 int cabinleft, cabintop, cabinright, cabinbottom; // TODO: should be protected w/accessors?
40 int cabinplane;
42 void setCabinRect(int l, int t, int r, int b) { cabinleft = l; cabintop = t; cabinright = r; cabinbottom = b; }
43 void setCapacity(unsigned int c) { capacity = c; }
44 unsigned int getBump() { return bump; }
46 std::vector<AgentRef> passengers;
48 virtual void carry(AgentRef);
49 virtual void drop(AgentRef);
50 virtual void adjustCarried(float xoffset, float yoffset);
52 virtual void tick();
53 virtual void kill();
56 #endif
57 /* vim: set noet: */