Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpUnitMotionFlying.h
- This file was added.
/* Copyright (C) 2019 Wildfire Games. | |||||
* This file is part of 0 A.D. | |||||
* | |||||
* 0 A.D. 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, either version 2 of the License, or | |||||
* (at your option) any later version. | |||||
* | |||||
* 0 A.D. 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. See the | |||||
* GNU General Public License for more details. | |||||
* | |||||
* You should have received a copy of the GNU General Public License | |||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | |||||
*/ | |||||
#ifndef INCLUDED_CCMPUNITMOTIONFLYING | |||||
#define INCLUDED_CCMPUNITMOTIONFLYING | |||||
#include "ICmpUnitMotionFlying.h" | |||||
#include "simulation2/system/Component.h" | |||||
#include "simulation2/components/ICmpPosition.h" | |||||
#include "simulation2/components/ICmpTerrain.h" | |||||
#include "simulation2/components/ICmpWaterManager.h" | |||||
#include "simulation2/components/ICmpRangeManager.h" | |||||
#include "simulation2/MessageTypes.h" | |||||
#include "ps/CLogger.h" | |||||
class CCmpUnitMotionFlying : public ICmpUnitMotionFlying | |||||
{ | |||||
public: | |||||
DEFAULT_COMPONENT_ALLOCATOR(UnitMotionFlying) | |||||
static void ClassInit(CComponentManager& componentManager); | |||||
static std::string GetSchema(); | |||||
virtual void Init(const CParamNode& paramNode); | |||||
virtual void Deinit(); | |||||
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)); | |||||
bool Move(fixed turnLength); | |||||
void StopMoving(); | |||||
void SetDebugOverlay(bool enabled); | |||||
void SetFacePointAfterMove(); | |||||
void SetSpeedMultiplier(fixed UNUSED(multiplier)); | |||||
void FaceTowardsPoint(fixed x, fixed z); | |||||
bool MoveToTargetRange(entity_id_t target, fixed minRange, fixed maxRange); | |||||
bool MoveToPointRange(fixed x, fixed z, fixed minRange, fixed maxRange); | |||||
pass_class_t GetPassabilityClass(); | |||||
std::string GetPassabilityClassName(); | |||||
fixed GetSpeedMultiplier(); | |||||
fixed GetCurrentSpeed(); | |||||
fixed GetRunMultiplier(); | |||||
fixed GetWalkSpeed(); | |||||
bool IsMoveRequested(); | |||||
private: | |||||
bool m_HasTarget; | |||||
bool m_ReachedTarget; | |||||
fixed m_TargetX; | |||||
fixed m_TargetZ; | |||||
fixed m_TargetMinRange; | |||||
fixed m_StationaryDistance; | |||||
fixed m_TargetMaxRange; | |||||
fixed m_Speed; | |||||
fixed m_MaxSpeed; | |||||
fixed m_TurnRate; | |||||
fixed m_BrakingRate; | |||||
fixed m_ClimbRate; | |||||
fixed m_FlyingHeight; | |||||
fixed m_LandingSpeed; | |||||
fixed m_SlowingRate; | |||||
fixed m_OvershootTime; | |||||
fixed m_TakeOffSpeed; | |||||
fixed m_AccelRate; | |||||
bool m_DiesInWater; | |||||
bool m_Landing; | |||||
bool m_OnGround; | |||||
fixed m_Pitch; | |||||
fixed m_Roll; | |||||
bool m_WaterDeath; | |||||
std::string m_PassabilityClassName; | |||||
pass_class_t m_PassabilityClass; | |||||
}; | |||||
REGISTER_COMPONENT_TYPE(UnitMotionFlying) | |||||
#endif // INCLUDED_CCMPUNITMOTIONFLYING |
Wildfire Games · Phabricator