BVB Source Codes

CRYENGINE Show VehicleDamageBehaviorGroup.cpp Source code

Return Download CRYENGINE: download VehicleDamageBehaviorGroup.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4. #include "VehicleDamageBehaviorGroup.h"
  5.  
  6. #include "IVehicleSystem.h"
  7. #include "VehicleSystem/Vehicle.h"
  8. #include "VehicleDamagesGroup.h"
  9.  
  10. CVehicleDamageBehaviorGroup::CVehicleDamageBehaviorGroup()
  11.         : m_pVehicle(nullptr)
  12. {}
  13.  
  14. //------------------------------------------------------------------------
  15. bool CVehicleDamageBehaviorGroup::Init(IVehicle* pVehicle, const CVehicleParams& table)
  16. {
  17.         m_pVehicle = (CVehicle*) pVehicle;
  18.  
  19.         CVehicleParams groupParams = table.findChild("Group");
  20.         if (!groupParams)
  21.                 return false;
  22.  
  23.         if (!groupParams.haveAttr("name"))
  24.                 return false;
  25.  
  26.         m_damageGroupName = groupParams.getAttr("name");
  27.         return !m_damageGroupName.empty();
  28. }
  29.  
  30. //------------------------------------------------------------------------
  31. void CVehicleDamageBehaviorGroup::Reset()
  32. {
  33. }
  34.  
  35. //------------------------------------------------------------------------
  36. void CVehicleDamageBehaviorGroup::OnDamageEvent(EVehicleDamageBehaviorEvent event, const SVehicleDamageBehaviorEventParams& behaviorParams)
  37. {
  38.         if (CVehicleDamagesGroup* pDamagesGroup = m_pVehicle->GetDamagesGroup(m_damageGroupName.c_str()))
  39.         {
  40.                 pDamagesGroup->OnDamageEvent(event, behaviorParams);
  41.         }
  42. }
  43.  
  44. //------------------------------------------------------------------------
  45. void CVehicleDamageBehaviorGroup::Serialize(TSerialize ser, EEntityAspects aspects)
  46. {
  47. }
  48.  
  49. //------------------------------------------------------------------------
  50. void CVehicleDamageBehaviorGroup::Update(const float deltaTime)
  51. {
  52. }
  53.  
  54. void CVehicleDamageBehaviorGroup::GetMemoryUsage(ICrySizer* s) const
  55. {
  56.         s->AddObject(this, sizeof(*this));
  57.         s->AddObject(m_damageGroupName);
  58. }
  59.  
  60. DEFINE_VEHICLEOBJECT(CVehicleDamageBehaviorGroup);
  61.  
downloadVehicleDamageBehaviorGroup.cpp Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top