
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "SpawnVolume.generated.h"
class UBoxComponent;
UCLASS()
class SPARTAPROJECT_API ASpawnVolume : public AActor
{
GENERATED_BODY()
public:
ASpawnVolume();
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Spawning")
USceneComponent* Scene;
// 스폰 영역을 담당할 박스 컴포넌트
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Spawning")
UBoxComponent* SpawningBox;
// 스폰 볼륨 내부에서 무작위 좌표를 얻어오는 함수
UFUNCTION(BlueprintCallable, Category="Spawning")
FVector GetRandomPointInVolume() const;
// 특정 아이템 클래스를 스폰하는 함수
UFUNCTION(BlueprintCallable, Category="Spawning")
void SpawnItem(TSubclassOf<AActor> ItemClass);
};
// SpawnVolume.h
UBoxComponent* SpawningBox;
UBoxComponent는 박스 내부에서 오버랩이나 충돌을 감지할 수 있는 컴포넌트GetRandomPointInVolume()
SpawnItem()
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> solution(vector<vector<int>> arr1, vector<vector<int>> arr2) {
vector<vector<int>> answer(arr1.size(), vector<int>(arr2[0].size(), 0));
for (int i = 0; i < arr1.size(); i++){
for (int j = 0; j < arr2[0].size(); j++){
for (int k = 0; k < arr1[0].size(); k++){
answer[i][j] += arr1[i][k] * arr2[k][j];
}
}
}
return answer;
}
m * n이고 행렬 B가 n * r크기일때 가능하다.(앞행렬의 행수) * (뒤 행렬의 열수) = m * r이 된다.