|
|
@ -3,7 +3,6 @@
|
|
|
|
#include "MyPlayerController.h"
|
|
|
|
#include "MyPlayerController.h"
|
|
|
|
#include "Kismet/GameplayStatics.h"
|
|
|
|
#include "Kismet/GameplayStatics.h"
|
|
|
|
#include "MyGameMode.h"
|
|
|
|
#include "MyGameMode.h"
|
|
|
|
#include "AIController.h"
|
|
|
|
|
|
|
|
#include "Net/UnrealNetwork.h"
|
|
|
|
#include "Net/UnrealNetwork.h"
|
|
|
|
|
|
|
|
|
|
|
|
AMyPlayerController::AMyPlayerController() : Super(), bIsMyTurn(false), SelectedTrooper(nullptr)
|
|
|
|
AMyPlayerController::AMyPlayerController() : Super(), bIsMyTurn(false), SelectedTrooper(nullptr)
|
|
|
@ -25,7 +24,7 @@ void AMyPlayerController::SetMyTurn(bool bMyTurn)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green,
|
|
|
|
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green,
|
|
|
|
FString::Printf(
|
|
|
|
FString::Printf(
|
|
|
|
TEXT("YOUR TURN!")));
|
|
|
|
TEXT("CURRENT TURN: %d"), PlayerIndex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// OnMyTurnChanged.ExecuteIfBound(bIsMyTurn);
|
|
|
|
// OnMyTurnChanged.ExecuteIfBound(bIsMyTurn);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -33,13 +32,13 @@ void AMyPlayerController::SetMyTurn(bool bMyTurn)
|
|
|
|
void AMyPlayerController::StartTurn_Implementation()
|
|
|
|
void AMyPlayerController::StartTurn_Implementation()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetMyTurn(true);
|
|
|
|
SetMyTurn(true);
|
|
|
|
UE_LOG(LogTemp, Warning, TEXT("Your turn"));
|
|
|
|
UE_LOG(LogTemp, Warning, TEXT("Your turn, %d"), PlayerIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AMyPlayerController::EndTurn_Implementation()
|
|
|
|
void AMyPlayerController::EndTurn_Implementation()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetMyTurn(false);
|
|
|
|
SetMyTurn(false);
|
|
|
|
UE_LOG(LogTemp, Warning, TEXT("Not your turn"));
|
|
|
|
UE_LOG(LogTemp, Warning, TEXT("Not your turn, %d"), PlayerIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto AMyPlayerController::GetMyGameMode() const
|
|
|
|
auto AMyPlayerController::GetMyGameMode() const
|
|
|
|