1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00
Files
OpenRCT2/src/openrct2/entity/Duck.h
2024-12-31 20:30:04 +01:00

51 lines
1.3 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2025 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "EntityBase.h"
class DataSerialiser;
struct CoordsXY;
struct PaintSession;
struct Duck : EntityBase
{
static constexpr auto cEntityType = EntityType::Duck;
enum class DuckState : uint8_t
{
FlyToWater,
Swim,
Drink,
DoubleDrink,
FlyAway,
};
uint16_t frame;
int16_t target_x;
int16_t target_y;
DuckState state;
static void Create(const CoordsXY& pos);
static void RemoveAll();
void Press();
void Update();
uint32_t GetFrameImage(int32_t direction) const;
bool IsFlying();
void Remove();
void Serialise(DataSerialiser& stream);
void Paint(PaintSession& session, int32_t imageDirection) const;
private:
void UpdateFlyToWater();
void UpdateSwim();
void UpdateDrink();
void UpdateDoubleDrink();
void UpdateFlyAway();
};