Files
SibIntel1/Source/MasharovDev/cppGI.h
T
2024-04-16 19:52:04 +05:00

107 lines
3.6 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);
/*assign -1 to set all, i.e. flat==-1 -> set whole floor, floor==-1 -> set whole house
* parts:
*Âñå ÷àñòè — 255
*Êóïîë — 0
*Âñå çäàíèÿ — 2
*Óëè÷íàÿ ïîäñâåòêà — 4
*Îôèñíàÿ ïîäñâåòêà — 8
*
states:
*0 — Âûêëþ÷èòü ÷àñòü
*1 — Âêëþ÷èòü ÷àñòü, â ðó÷íîì ðåæèìå(÷àñòü ðàáîòàåò â ñòàòè÷åñêîì ðåæèìå, äåíü íî÷ü íà íåé, íå ìåíÿåòñÿ)
*2 — Âêëþ÷èòü ÷àñòü, â àâòîìàòè÷åñêîì ðåæèìå(÷àñòü ðàáîòàåò â ðåæèìå ñìåíû äíÿ è íî÷è)*/
UFUNCTION(blueprintcallable, Category = "maketConnection")
void setPartState(uint8 part, uint8 state);
};