OpenTTD Source 20260206-master-g4d4e37dbf1
effectvehicle_base.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef EFFECTVEHICLE_BASE_H
11#define EFFECTVEHICLE_BASE_H
12
13#include "vehicle_base.h"
14#include "transparency.h"
15
24struct EffectVehicle final : public SpecializedVehicle<EffectVehicle, VEH_EFFECT> {
25 uint16_t animation_state = 0;
26 uint8_t animation_substate = 0;
27
28 EffectVehicle(VehicleID index) : SpecializedVehicleBase(index) {}
30 ~EffectVehicle() override = default;
31
32 void UpdateDeltaXY() override;
33 bool Tick() override;
35};
36
37#endif /* EFFECTVEHICLE_BASE_H */
void UpdateDeltaXY() override
Updates the x and y offsets and the size of the sprite used for this vehicle.
TransparencyOption GetTransparencyOption() const
Determines the transparency option affecting the effect.
uint8_t animation_substate
Sub state to time the change of the graphics/behaviour.
~EffectVehicle() override=default
We want to 'destruct' the right class.
bool Tick() override
Calls the tick handler of the vehicle.
uint16_t animation_state
State primarily used to change the graphics/behaviour.
SpecializedVehicle< EffectVehicle, Type > SpecializedVehicleBase
Functions related to transparency.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
Base class for all vehicles.
PoolID< uint32_t, struct VehicleIDTag, 0xFF000, 0xFFFFF > VehicleID
The type all our vehicle IDs have.