You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
awesome_game/Source/TurnBasedTutorial/Trooper.h

56 lines
1.0 KiB

#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/Character.h"
#include "Trooper.generated.h"
UCLASS()
class TURNBASEDTUTORIAL_API ATrooper : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ATrooper();
void Initialize(uint8 const NewPlayerIndex, FVector const SpawnLocation, uint8 const NewId);
UFUNCTION()
uint8 GetPlayerIndex() const;
UFUNCTION()
void MoveTrooper(FVector const NewPos);
UFUNCTION()
uint8 GetId() const;
protected:
virtual void BeginPlay() override;
virtual void Tick(float const DeltaTime) override;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
UStaticMeshComponent* MyStaticMesh;
private:
UPROPERTY(Replicated)
uint8 PlayerIndex;
UPROPERTY(Replicated)
uint8 Id;
UPROPERTY()
float Speed = 300.0f;
UPROPERTY(Replicated)
FVector CurrentLocation;
UPROPERTY(Replicated)
FVector TargetLocation;
UPROPERTY(Replicated)
bool bIsMoving = false;
};