Mercurial > hg > openttd
annotate src/effectvehicle_base.h @ 14396:4de60292e2a6 draft
(svn r18953) -Feature: [NoAI] allow editing AI settings while an AI is running
Only settings with the AICONFIG_INGAME flag can be editted in this way
author | yexo <yexo@openttd.org> |
---|---|
date | Fri, 29 Jan 2010 21:38:55 +0000 |
parents | bc7926153e19 |
children | 562c2d5b012b |
rev | line source |
---|---|
9009
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
2 |
12778
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
3 /* |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
4 * This file is part of OpenTTD. |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
8 */ |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
12095
diff
changeset
|
9 |
9009
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
10 /** @file effectvehicle_base.h Base class for all effect vehicles. */ |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
11 |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
12 #ifndef EFFECTVEHICLE_BASE_H |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
13 #define EFFECTVEHICLE_BASE_H |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
14 |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
15 #include "vehicle_base.h" |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
16 |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
17 /** |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
18 * A special vehicle is one of the following: |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
19 * - smoke |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
20 * - electric sparks for trains |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
21 * - explosions |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
22 * - bulldozer (road works) |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
23 * - bubbles (industry) |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
24 */ |
12034
aa140a9c419c
(svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types
smatz <smatz@openttd.org>
parents:
11978
diff
changeset
|
25 struct EffectVehicle : public SpecializedVehicle<EffectVehicle, VEH_EFFECT> { |
11978
2e291154df46
(svn r16384) -Codechange: move u.effect to EffectVehicle
rubidium <rubidium@openttd.org>
parents:
11970
diff
changeset
|
26 uint16 animation_state; |
2e291154df46
(svn r16384) -Codechange: move u.effect to EffectVehicle
rubidium <rubidium@openttd.org>
parents:
11970
diff
changeset
|
27 byte animation_substate; |
2e291154df46
(svn r16384) -Codechange: move u.effect to EffectVehicle
rubidium <rubidium@openttd.org>
parents:
11970
diff
changeset
|
28 |
12095
330c67eebb69
(svn r16505) -Fix [FS#2951] (r16472): since g++ 4.4 the implicit (default) constructor will zero the whole class. This caused all vehicle indices to be 0, which causes all kinds of trouble.
rubidium <rubidium@openttd.org>
parents:
12065
diff
changeset
|
29 /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ |
330c67eebb69
(svn r16505) -Fix [FS#2951] (r16472): since g++ 4.4 the implicit (default) constructor will zero the whole class. This caused all vehicle indices to be 0, which causes all kinds of trouble.
rubidium <rubidium@openttd.org>
parents:
12065
diff
changeset
|
30 EffectVehicle() : SpecializedVehicle<EffectVehicle, VEH_EFFECT>() {} |
9009
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
31 /** We want to 'destruct' the right class. */ |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
32 virtual ~EffectVehicle() {} |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
33 |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
34 const char *GetTypeString() const { return "special vehicle"; } |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
35 void UpdateDeltaXY(Direction direction); |
11970
2286db6ac0bb
(svn r16376) -Codechange: Vehicle::Tick() now returns false if the vehicle was deleted
smatz <smatz@openttd.org>
parents:
9009
diff
changeset
|
36 bool Tick(); |
9009
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
37 }; |
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
38 |
12035
dcc31c1d758a
(svn r16442) -Codechange: use new Vehicle accessors at more places
smatz <smatz@openttd.org>
parents:
12034
diff
changeset
|
39 #define FOR_ALL_EFFECTVEHICLES(var) FOR_ALL_VEHICLES_OF_TYPE(EffectVehicle, var) |
dcc31c1d758a
(svn r16442) -Codechange: use new Vehicle accessors at more places
smatz <smatz@openttd.org>
parents:
12034
diff
changeset
|
40 |
9009
870efbdb988d
(svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
41 #endif /* EFFECTVEHICLE_BASE_H */ |