初步修复
This commit is contained in:
parent
8fc4357cc6
commit
e4714f3f0e
46705 changed files with 12004901 additions and 0 deletions
32
GameCommon/ReputationSystem.cpp
Normal file
32
GameCommon/ReputationSystem.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
#include "Stdafx.h"
|
||||
#include "ReputationSystem.h"
|
||||
#include "ReputationSystemEventHandler.h"
|
||||
|
||||
#if defined( PRE_ADD_NPC_REPUTATION_SYSTEM )
|
||||
|
||||
void IReputationSystem::Add( const eType Type, const REPUTATION_TYPE value, bool bIsReachMax )
|
||||
{
|
||||
bool bIsBeforeComplete = IsComplete( Type );
|
||||
_Add( Type, value, bIsReachMax );
|
||||
if( m_pEventHandler )
|
||||
m_pEventHandler->OnChange( Type ); // Change Event
|
||||
bool bIsAfterComplete = IsComplete( Type );
|
||||
|
||||
if( m_pEventHandler && bIsAfterComplete && !bIsBeforeComplete )
|
||||
m_pEventHandler->OnComplete( this, Type ); // Complete Event
|
||||
}
|
||||
|
||||
void IReputationSystem::Set( const eType Type, const REPUTATION_TYPE value )
|
||||
{
|
||||
bool bIsBeforeComplete = IsComplete( Type );
|
||||
_Set( Type, value );
|
||||
if( m_pEventHandler )
|
||||
m_pEventHandler->OnChange( Type ); // Change Event
|
||||
bool bIsAfterComplete = IsComplete( Type );
|
||||
|
||||
if( m_pEventHandler && bIsAfterComplete && !bIsBeforeComplete )
|
||||
m_pEventHandler->OnComplete( this, Type ); // Complete Event
|
||||
}
|
||||
|
||||
#endif // #if defined( PRE_ADD_NPC_REPUTATION_SYSTEM )
|
||||
Loading…
Add table
Add a link
Reference in a new issue