50 lines
1.1 KiB
Ucode
50 lines
1.1 KiB
Ucode
|
/**
|
||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Provides a base class for commonly needed MCP functions
|
||
|
*/
|
||
|
class MCPBase extends McpServiceBase
|
||
|
native
|
||
|
abstract
|
||
|
inherits(FTickableObject)
|
||
|
config(Engine);
|
||
|
|
||
|
cpptext
|
||
|
{
|
||
|
// FTickableObject interface
|
||
|
|
||
|
/**
|
||
|
* Returns whether it is okay to tick this object. E.g. objects being loaded in the background shouldn't be ticked
|
||
|
* till they are finalized and unreachable objects cannot be ticked either.
|
||
|
*
|
||
|
* @return TRUE if tickable, FALSE otherwise
|
||
|
*/
|
||
|
virtual UBOOL IsTickable() const
|
||
|
{
|
||
|
// We cannot tick objects that are unreachable or are in the process of being loaded in the background.
|
||
|
return !HasAnyFlags( RF_Unreachable | RF_AsyncLoading );
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Used to determine if an object should be ticked when the game is paused.
|
||
|
*
|
||
|
* @return always TRUE as networking needs to be ticked even when paused
|
||
|
*/
|
||
|
virtual UBOOL IsTickableWhenPaused() const
|
||
|
{
|
||
|
return TRUE;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Needs to be overridden by child classes
|
||
|
*
|
||
|
* @param ignored
|
||
|
*/
|
||
|
virtual void Tick(FLOAT)
|
||
|
{
|
||
|
check(0 && "Implement this in child classes");
|
||
|
}
|
||
|
}
|