106 lines
4.0 KiB
C++
106 lines
4.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Engine/GameInstance.h"
|
|
#include "cppGI.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct Fcppcoords
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 flat = -1;
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 type = 0;
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 zone = 1;
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 house = -1;
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 section = -1;
|
|
UPROPERTY(BlueprintReadWrite, category = "default")
|
|
int32 floor = -1;
|
|
};
|
|
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FcppLevelStruct
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(BlueprintReadWrite)
|
|
Fcppcoords coords;
|
|
UPROPERTY(BlueprintReadWrite)
|
|
bool dontUnload = false;
|
|
UPROPERTY(BlueprintReadWrite)
|
|
FString path;
|
|
UPROPERTY(BlueprintReadWrite)
|
|
float Z = 0;
|
|
UPROPERTY(BlueprintReadWrite)
|
|
int32 anotherLvl = -1;
|
|
};
|
|
|
|
UCLASS()
|
|
class MASHAROVDEV_API UcppGI : public UGameInstance
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
UFUNCTION(blueprintcallable, category = "cppFuncLib")
|
|
static void cppCoordsEq(Fcppcoords coords, Fcppcoords coords1, bool relevantMinus2, bool fastEq, bool& flat_, bool& type_, bool& zone_, bool& house_, bool& section_, bool& floor_, bool& fullEq);
|
|
|
|
|
|
/*returns array of levels for binding and array of lvlstruct for loading*/
|
|
UFUNCTION(blueprintcallable, Category = "Level Loading", meta = (WorldContext = "WorldContextObject"))
|
|
void cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords, uint8 currentState, TArray<ULevelStreaming*>& Levelss);
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "levelLoading", meta = (MultiLine = "true"))
|
|
TArray<FcppLevelStruct> cpplevelLIst;
|
|
/** used if need to load some levels instantly. -2 of any coord is use current. */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Level Loading", meta = (MultiLine = "true"))
|
|
TArray<Fcppcoords> cpplvlsForLoading;
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Level Loading", meta = (MultiLine = "true"))
|
|
TArray<FName> cppdynamicLvls;
|
|
|
|
UFUNCTION(blueprintcallable, Category = "maketConnection")
|
|
void avoidAutoState();
|
|
UFUNCTION(blueprintcallable, Category = "maketConnection")
|
|
void makeSocket(FString ip, int port);
|
|
/*codes:
|
|
*0 - цвет купола в режиме работы с приложением
|
|
*1 - первый цвет подсветки квартир (например, подсветка всего здания при его выборе)
|
|
*2 - второй цвет подсветки квартир (например, подсветка выбранных квартир) */
|
|
UFUNCTION(blueprintcallable, Category = "maketConnection")
|
|
void setColor(uint8 code, FColor color);
|
|
/*assign -1 to set all, i.e. flat==-1 -> set whole floor, floor==-1 -> set whole house
|
|
states:
|
|
*0 — Выключить подсветку(нельзя изменить)
|
|
*1 — Подсветка первым цветом(задаётся командой)
|
|
*2 — Подсветка вторым цветом(задаётся командой)
|
|
*3 — Подсветка белым цветом(нельзя изменить)*/
|
|
UFUNCTION(blueprintcallable, Category = "maketConnection")
|
|
void setLight(int house=-1, int floor=-1, int strip=-1, uint8 state=0);
|
|
/* parts:
|
|
*Все части — 255
|
|
*Купол — 1
|
|
*Все здания — 2
|
|
*Уличная подсветка — 4
|
|
*Офисная подсветка — 8
|
|
* доступно битовое ИЛИ
|
|
states:
|
|
*0 — Выключить часть
|
|
*1 — Включить часть, в ручном режиме(часть работает в статическом режиме, день ночь на ней, не меняется)
|
|
*2 — Включить часть, в автоматическом режиме(часть работает в режиме смены дня и ночи)*/
|
|
UFUNCTION(blueprintcallable, Category = "maketConnection")
|
|
|
|
void setPartState(uint8 part, uint8 state);
|
|
|
|
|
|
};
|