DragonNest/Server/DNGameServer/GrowingAreaStateNone.cpp
2024-12-20 16:56:44 +08:00

39 lines
1.7 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


#include "Stdafx.h"
#include "GrowingAreaStateNone.h"
#include "GrowingArea.h"
#include "DNFarmGameRoom.h"
#include "DNUserSession.h"
bool CFarmAreaStateNone::CanStartPlantSeed()
{
if( m_pArea->GetPlantSeed() )
return false;
return true;
}
void CFarmAreaStateNone::BeginProcess()
{
m_pArea->DestroySeed();
SendBeginAreaState();
}
void CFarmAreaStateNone::Process( float fDelta )
{
}
void CFarmAreaStateNone::EndProcess()
{
if( m_pArea->GetState() == Farm::AreaState::PLANTING )
{
CPlantSeed* pSeed = m_pArea->GetPlantSeed();
CDNUserSession* pSession = m_pArea->GetUserSession( m_pArea->GetOwnerCharacterDBID() );
if( pSession )
pSession->SendFarmPlantSeed( ERROR_NONE, Farm::ActionType::START, m_pArea->GetIndex(), pSeed->GetSeedItemID(), pSeed->GetFirstAttachItemID() );
}
}