ALeafNode::ALeafNode(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { PrimaryActorTick.bCanEverTick = true; FRandomStream Rand = FRandomStream(); // The SceneComponent gives this AActor class a transform to represent it's location in World Space. SceneComponent = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("SceneComponent")); SceneComponent->SetMobility(EComponentMobility::Movable); SetRootComponent(SceneComponent); }
void ASpellDeck::Shuffle() { int64 DateInSeconds = FDateTime::Now().ToUnixTimestamp(); FRandomStream SRand = FRandomStream(); SRand.Initialize(DateInSeconds); int32 j; for (int32 i = spellDeck.Num() - 1; i > 0; i--) { j = FMath::FloorToInt(SRand.FRand()*(i + 1)); UActionCard* temp = spellDeck[i]; spellDeck[i] = spellDeck[j]; spellDeck[j] = temp; } }
FRandomStream UKismetMathLibrary::MakeRandomStream(int32 InitialSeed) { return FRandomStream(InitialSeed); }