Module |
|
Header |
/Engine/Source/Runtime/Engine/Public/UnrealEngine.h |
Include |
#include "UnrealEngine.h" |
template<class T, bool LocalOnly>
class TBasePlayerControllerIterator
PlayerControllerIterators This is the safest, most efficient way to iterate over player controllers.
Examples:
for (TPlayerControllerIterator<AQAPlayerController>::LocalOnly It(GetWorld()); It; ++It) { // PC is a locally controlled AQAPlayerController. AQAPlayerController * PC = *It;
// This PC will always be locally controlled! check(PC->IsLocalController(); }
for (TPlayerControllerIterator<AQAPlayerController>::ServerAll It(GetWorld()); It; ++It) { // PC is a AQAPlayerController. It may local or remotely controlled. AQAPlayerController * PC = *It;
// This can only be done on the server! // Only the server has player controllers for everyone! check(GetWorld()->GetNetMode() != NM_Client); }
Name | Description | ||
---|---|---|---|
|
T * |
Current |
|
|
Iter |
Name | Description | |
---|---|---|
|
TBasePlayerControllerIterator ( |
Name | Description | ||
---|---|---|---|
|
AdvanceCurrent() |
||
|
Next() |
Name | Description | ||
---|---|---|---|
|
operator bool() |
||
|
T * |
operator*() |
|
|
operator++() |
||
|
T * |
operator->() |