Develop Document : Lane - Tiny-Metro/Poly-Metro GitHub Wiki
์ธ๊ฒ์์์ ์ญ๊ณผ ์ญ์ ์ด์ด์ฃผ๋ ์ญํ ์ ํฉ๋๋ค.
๋ ธ์ ์ ํฐ์น, ํด๋ฆญ์ผ๋ก ์์ฑ, ์ฐ์ฅ, ์ทจ์ํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ Document : ์ธ๊ฒ์ ์์ ํ์ธํ ์ ์์ต๋๋ค.
๋ ธ์ ์ LaneManager์ Lane ํด๋์ค์ ๊ตฌํ๋์ด ์์ต๋๋ค. LaneManager ์์ฑ์ TinyMetroGameModeBase ์์ ๋ด๋นํฉ๋๋ค.
์ญ์ ํ๋ ํด๋ฆญ/ํฐ์นํ ๋๋ง๋ค AddSelectedStations๋ก SelectedStations ๋ฐฐ์ด์ ์ญ์ ์ถ๊ฐํฉ๋๋ค.
IsPlacementValid ๋ณ์๋ก ๋ ธ์ ์ฐ์ฅ/์ถ์ ์ ์์ฑ์ ๊ตฌ๋ถํฉ๋๋ค.
IsPlacementValid ์ด false๋ฉด ๋ ธ์ ์์ฑ์ผ๋ก SelectedStations์ ์ญ์ด 2๊ฐ๊ฐ ๋๋ฉด CreatingNewLaneํจ์๋ฅผ ๋ถ๋ฌ ์๋ก์ด ๋ ธ์ ์ ์์ฑํ๊ณ , SelectedStations๋ฅผ ์ด๊ธฐํํฉ๋๋ค.
์๋ก ์๊ธด ๋ ธ์ ์๋ ์ด์ฐจ ์์ดํ ์ด ์์ผ๋ฉด Lane์ SpawnTrainํจ์๋ก ์ด์ฐจ๋ฅผ ํ๋ ์คํฐํฉ๋๋ค.
๋ ธ์ ์ ์์ชฝ ํธ๋ค์ ํด๋ฆญ/ํฐ์นํ๋ฉด ์ด๋ฒคํธ๋ก LaneManager์ IsPlacementValid ๋ณ์๋ฅผ true๋ก ๋ง๋ญ๋๋ค.
๊ทธ๋ฆฌ๊ณ Is Start/End Handle Editing ๋ณ์๋ฅผ true๋ก ๋ง๋ญ๋๋ค.
์ด ์ํ์์ SelectedStations์ ์ญ์ด ์ถ๊ฐ๋๋ฉด ํด๋น Lane์ ExtendLaneํจ์๋ฅผ ๋ถ๋ฌ์ค๊ณ , SelectedStations๋ฅผ ์ด๊ธฐํํฉ๋๋ค.
ExtendLane์์๋ IsPlacementValid์ Is Handle Editing ๋ณ์๋ก AddStationStart์ AddStationEnd ๋ ์ค ํ๋์ ํจ์๋ฅผ ๋ถ๋ฌ ์ฐ์ฅ/์ถ์๋ฅผ ํ๋ณํฉ๋๋ค.
๋ค์์ AddStationStart/End ๊ฐ ์ ํํ ์ญ์ ๋ฐ๋ผ ๋ ธ์ ์ ์ฐ์ฅ ์ถ์๋ฅผ ํ๋ณํ๋ ๋ฐฉ์์ ๋๋ค.
1. ๋จผ์ ๋
ธ์ ์ ๊ฐ์๊ฐ 2๊ฐ์ธ์ง ํ์ธํฉ๋๋ค.
1-1. 2๊ฐ๋ฉด ์ ํํ ์ญ์ด ํด๋ฆญํ ๋
ธ์ ๋ด์์ ํธ๋ค์ ๋ฐ๋ํธ ๋์ ํด๋นํ๋์ง ํ์ธํฉ๋๋ค.
1-1-1. ํด๋นํ๋ฉด ๋
ธ์ ์ ์ญ์ ํฉ๋๋ค.
1-1-2. ํด๋นํ์ง ์์ผ๋ฉด ๋
ธ์ ์ ์ฐ์ฅํฉ๋๋ค.
1-2. 2๊ฐ๊ฐ ์๋๋ฉด 2๋ฒ์ผ๋ก ์งํํฉ๋๋ค.
2. ๋ค์์๋ ์ด ๋
ธ์ ์ด ์ํ์ ์ธ์ง ํ์
ํฉ๋๋ค.
2-1. ์ํ์ ์ด๋ฉด ์ ํํ ์ญ์ด ๋
ธ์ ๋ด์์ ํธ๋ค์ 2๋ฒ์งธ๋ก ์ธ์ ํ ์ญ์ธ์ง ํ์ธํฉ๋๋ค.
2-1-1. ๋ง๋ค๋ฉด ์ํ์ ์ ํด์ ํฉ๋๋ค.
2-2. ์ํ์ ์ด ์๋๋ฉด 3๋ฒ์ผ๋ก ์งํํฉ๋๋ค.
3. ์ ํํ ์ญ์ด ํด๋ฆญํ ๋
ธ์ ๋ด์์ ํธ๋ค์ ๋ฐ๋ํธ ๋์ ํด๋นํ๋์ง ํ์ธํฉ๋๋ค.
3-1. ๋ง๋ค๋ฉด ์ํ์ ์ผ๋ก ๋ง๋ญ๋๋ค.
3-2. ์๋๋ผ๋ฉด 4๋ฒ์ผ๋ก ์งํํฉ๋๋ค.
4. ๋
ธ์ ๋ด์ ์ ํํ ์ญ์ด ์๋์ง ํ์ธํฉ๋๋ค.
4-1. ๋ง๋ค๋ฉด ํด๋น ์ญ๊น์ง ๋
ธ์ ์ ์ถ์ํฉ๋๋ค.
4-2. ์๋๋ผ๋ฉด 5๋ฒ์ผ๋ก ์งํํฉ๋๋ค.
5. ๋
ธ์ ์ ์ฐ์ฅํฉ๋๋ค.
์ด๋ฌํ ํฐ ์ค๊ธฐ์ ๋ช ๊ฐ์ง ์กฐ๊ฑด์ด ๋ ๋ถ์ต๋๋ค.
๋ ธ์ ์ ์ฐ์ฅํ ๋ ๋ค๋ฆฌ/ํฐ๋ ์์ดํ ๊ฐ์๋ฅผ ํ์ธํ๊ณ , ์ญ์ ๋ ๋ ธ์ ์ ์ด์ฐจ๊ฐ ์๋ค๋ฉด ์ง์ฐ ์ญ์ ๋ฅผ ์์ฝํฉ๋๋ค.
๋ ธ์ ๋ด๋ถ์์ ์ฐ์ฅ/์ถ์ ์์ ์ ํ ๋ค์๋ ๋์ ๋ณด์ด๋ ๋ถ๋ถ์ ์ฐ์ฅ/์ถ์ ์ํต๋๋ค.
๊ทธ๋ฆฌ๊ณ ํธ๋ค๋ ๋ฐ๋ ๋ ธ์ ์ ๋ง๊ฒ ์กฐ์ ํฉ๋๋ค.
๋ ธ์ ์ถ์/์ญ์ ๋ฅผ ํ ๋ ์ด์ฐจ๊ฐ ๊ทธ ๊ตฌ๊ฐ์ ์ง๋๊ฐ ๋ ๋ฐ๋ก ์ญ์ ๋๋ค๋ฉด ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
๊ทธ๋์ ์์ ๊ฒฝ์ฐ ํด๋น ๊ตฌ๊ฐ์ ์ญ์ ๋ ๊ตฌ๊ฐ์ผ๋ก ๋ง๋ค๊ณ ์ด์ฐจ๊ฐ ์ง๋๊ฐ๋ฉด ์ฒ๋ฆฌํฉ๋๋ค.
์ญ์ ์ ์ฅํ๋ StatonPoint ๋ฐฐ์ด์์๋ ์ฆ์ ์ญ์ ์ง์ฐ๊ณ , ์ง์ฐ๊ธฐ ์ ๊ฐ์ ๋ฐ๋ก StationPointBeforeRemoved์ ์ ์ฅํฉ๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ง์์ง ์ญ๋ค์ StationsToBeRemoved ๋ฐฐ์ด๋ก ์ ์ฅํฉ๋๋ค.
์ญ์ ๋ ๊ตฌ๊ฐ์ ์ง๋๊ฐ๋ ์ด์ฐจ๋ค์๊ฒ TrainManager์ NotifyTrainsOfRemoving ํจ์๋ก ์๋ฆฝ๋๋ค.
Lane์ Tickํจ์์์ FinishRemovingLane/ FinishClearing ํจ์๋ฅผ ๋ถ๋ฌ ์ด์ฐจ๋ฅผ ํ์ธํ ํ, ์๋ค๋ฉด ์ถ์/์ญ์ ๋ฅผ ์งํํฉ๋๋ค.
๋ ธ์ ์ ๋๋ธ ํด๋ฆญํ๋ฉด ํด๋น ๊ตฌ๊ฐ์ ๋ฐ๋๋ก ๋ ธ์ ๋ชจ์์ด ๋ณ๊ฒฝ๋ฉ๋๋ค.
LaneArray์ ์๋ SplineMeshComponent์ ๊ฐ๊ฐ AddDynamic์ผ๋ก ํฐ์น, ํด๋ฆญ ์ด๋ฒคํธ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
CheckDoubleTap, CheckDoubleClick์ผ๋ก ๋๋ธ ํด๋ฆญ์ ํ๋ณํ๊ณ ๋ง๋ค๋ฉด DoubleTapEvent ํจ์๋ก ๋์ด๊ฐ ์ด๋ฒคํธ๊ฐ ์ผ์ด๋ ๋ฉ์๊ฐ ์๋ ๊ตฌ๊ฐ์ ๋ฐ์ต๋๋ค.
๊ตฌ๊ฐ ์ ๋์ ํด๋นํ๋ Station์ GetConnectedStations ํจ์๋ก ์ฐพ๊ณ , ์ด๋ฅผ CheckIsChangableLaneAppearance ํจ์๋ก ๋๊น๋๋ค.
์ด ํจ์์์๋ ๋ชจ์ ๋ณ๊ฒฝ์ด ๊ฐ๋ฅํ์ง ํ์ ํ๊ธฐ ์ํด BridgeTunnel ์์ดํ ์ ๊ฐ์, ์ ๋ ์ญ์ ๋ชฉ์ ์ง๋ก ๊ฐ๋ ์ด์ฐจ์ ๊ฐ์๋ฅผ ํ์ธํฉ๋๋ค.
๋จผ์ ํ์ฌ ๊ฒฝ๋ก๋ก์ FLanePoint๋ค์ ์ฐพ์ ๋ฐฐ์น๋ BridgeTunnel ์์ดํ ์ ๊ฐ์์ ๋ณด์ ํ๊ณ ์๋ ์์ดํ ๊ฐ์๋ฅผ ๋ํ ๊ฐ๊ณผ,
์๋ก ๋ง๋ค์ด์ง ๊ฒฝ๋ก์ FLanePoint๋ค์ ๋ฐฐ์น๋ BridgeTunnel ์์ดํ ์ ๊ฐ์๋ฅผ ๋น๊ตํฉ๋๋ค.
์ฌ๊ธฐ์ ๊ฐ๋ฅํ๋ค๋ฉด ์ด์ฐจ์ ๊ฐ์๋ฅผ ํ์ธํ๊ณ ์ด์ฐจ๊ฐ ์๋ค๋ฉด DisConnectBT๋ฅผ ํ ๋ค, ChangeLaneAppearance ํจ์๋ก, ์์ผ๋ฉด ์ง์ฐ ๋ณ๊ฒฝ์ ์งํํฉ๋๋ค.
์ง์ฐ ๋ณ๊ฒฝ์ ์์ ์ค๋ช ํ ์ง์ฐ ์ญ์ ์ ์๋ ๋ฐฉ์์ด ๊ฐ์ต๋๋ค.
ChangeLaneAppearance๋ ์๋ก์ด ๊ฒฝ๋ก๋ฅผ LaneArray์ ๋ฎ์ด์ฐ๊ณ , Spline์ ๋ง๋ค์ด ์๋ก์ด ๋ฉ์๋ฅผ ์ฐ๊ฒฐํฉ๋๋ค.
๊ทธ๋ฆฌ๊ณ ํ์ํ BridgeTunnel Item์ ConnectBT๋ก ์ถ๊ฐํฉ๋๋ค.
- Property
- TMap<int32, ALane*> Lanes;
- Lane ํฌ์ธํฐ๋ฅผ ์ ์ฅํ ๋ฐฐ์ด์ ๋๋ค.
- bool IsPlacementValid;
- True๋ฉด ๋ ธ์ ์ ํธ๋ค์ ์ ํํ ์ํ์ ๋๋ค.
- FLaneSelectDelegate LaneSelectDelegate;
- Lane์ ์ ํํ์ ๋ ์คํ๋ฉ๋๋ค.
- FLaneCancelDelegate LaneCancelDelegate;
- Lane ์ ํ์ ์ทจ์ํ์ ๋ ์คํ๋ฉ๋๋ค.
- UClass* LaneClass = nullptr;
- bool CanAssignBridge;
- bool CanAssignTunnel;
- TArray NextLaneNums = {1,2,3,4,5,6,7,8};
- ์๋ก ์์ฑ๋ Lane์ Id ๋ฆฌ์คํธ์ ๋๋ค.
- TArray<UMaterial*> LaneMaterial;
- TArray LaneMaterialPath;
- int32 SelectedLaneNum;
- ํ์ฌ ์ ํ๋ Lane์ Id์ ๋๋ค.
- int32 UILaneNum;
- UI์ ํ์๋ Lane์ Id์ ๋๋ค.
- TArray<class AStation*> SelectedStations;
- ํ์ฌ ์ ํ๋ ์ญ์ ํฌ์ธํฐ๋ฅผ ๋ด์ ๋ฐฐ์ด์ ๋๋ค.
- TMap<int32, ALane*> Lanes;
- Function
- int32 GetLaneCount() const;
- Lane ๊ฐ์๋ฅผ ๋ฐ์ต๋๋ค.
- int32 GetRandomLaneId() const;
- void SetCanAssginBridge(bool AssginBridge);
- void SetCanAssginTunnel(bool AssginTunnel);
- void AddNextLaneNums(int32 LaneNum);
- NextLaneNums์ LaneNum์ ์ถ๊ฐํ๊ณ ์ ๋ ฌํฉ๋๋ค.
- void RemoveNextLaneNums();
- NextLaneNums์ ์ฒซ ์์๋ฅผ ์ง์๋๋ค.
- void RemoveDestroyedLane(int LaneNum);
- void SetUILaneNum(int32 Num);
- UILaneNum์ ์ค์ ํฉ๋๋ค.
- int32 GetUILaneNum();
- UILaneNum์ ๋ฐ์ต๋๋ค.
- void SetSelectedLaneNum(int32 Num);
- SelectedLaneNum์ ๋ฐ๊ณ UILaneNum์ ์ค์ ํฉ๋๋ค.
- void AddSelectedStations(class AStation* Station);
- SelectedStations์ Station์ ์ถ๊ฐํ๊ณ ์กฐ๊ฑด์ ๋ฐ๋ผ ๋ ธ์ ์์ฑ, ์ฐ์ฅ, ์ถ์ ๋ฑ์ ๊ฒฐ์ ํฉ๋๋ค.
- void CancelSelectedStations();
- SelectedStations๋ฅผ ๋น์๋๋ค.
- class ALane* SpawnLane();
- Lane ์คํฐํจ์์ ๋๋ค.
- void CreatingNewLane();
- ์๋ก์ด ๋ ธ์ ์ ๋ง๋๋ ํจ์์ ๋๋ค.
- ALane* GetLaneById(int32 LaneId);
- LaneId๋ก Lane ํฌ์ธํฐ๋ฅผ ๋ฐํํฉ๋๋ค.
- void InitLaneMaterial();
- void LaneMaterialDeferred();
- TArray<UMaterial*> GetLaneMaterial() const;
- int32 GetPosition(FIntPoint Start, FIntPoint End);
- void Save();
- LaneManager์ Lane์ ์ ๋ณด๋ฅผ ์ ์ฅํฉ๋๋ค.
- bool Load();
- LaneManagerSaveGame์ผ๋ก๋ถํฐ ์ ์ฅ๋ ์ ๋ณด๋ฅผ ๋ฐ์ ์ ๋ณด๋ฅผ ๋ฃ์ต๋๋ค.
- class ALane* LoadLane(int32 LaneId);
- ๊ฐ Lane์ Load ํจ์๋ฅผ ํธ์ถํฉ๋๋ค.
- void CheckTransferStation();
- ํ์น์ญ์ ์ง๊ณํด Statistics์ ์ ์ฅํฉ๋๋ค.
- int32 GetLaneCount() const;
-
PopHandle
- Property
- static FOnPopHandleCalled OnPopHandleCalled;
- bool CurrentlyPoppingLane;
- Function
- virtual void PopHandle(bool isUp) override;
- void OnOtherLanePopHandleCalled(bool isUp);
- Property
-
Lane Information
- Property
- int32 LaneId;
- ๋ ธ์ ์ ๋ฒํธ์ ๋๋ค.
- bool IsCircularLine;
- ์ํ์ ์ฌ๋ถ๋ฅผ ์ ์ฅํฉ๋๋ค.
- TArray<class AStation*> StationPoint;
- ๋ ธ์ ์ด ๊ฐ์ง ์ญ์ ๋ฐฐ์ด์ ๋๋ค.
- TArray LaneArray;
- ๋ ธ์ ์ด ๊ฐ์ง ๊ทธ๋ฆฌ๋ ์์ ์ง์ ์ ๋๋ค.
- int32 LaneId;
- Function
- int32 GetLaneId();
- ๋ ธ์ ๋ฒํธ๋ฅผ ๋ฐํํฉ๋๋ค.
- void SetLaneId(int _LaneId);
- ๋ ธ์ ๋ฒํธ๋ฅผ ์ค์ ํฉ๋๋ค.
- bool GetIsCircularLine();
- ์ํ์ ์ฌ๋ถ๋ฅผ ๋ฐํํฉ๋๋ค.
- void SetIsCircularLine(bool _Circular);
- ์ํ์ ์ฌ๋ถ๋ฅผ ์ค์ ํฉ๋๋ค.
- int32 GetLaneId();
- Property
-
Delay Removing
- Property
- TArray <AStation*> StationsToBeRemovedAtEnd;
- ๋ ธ์ ์ ๋ ๋ถ๋ถ์์ ์ญ์ ๋ ์ญ์ ๋๋ค.
- TArray <AStation*> StationsToBeRemovedAtStart;
- ๋ ธ์ ์ ์์ ๋ถ๋ถ์์ ์ญ์ ๋ ์ญ์ ๋๋ค.
- TArray <AStation*> StationPointBeforeRemovedEnd;
- ๋ ธ์ ๋ ๋ถ๋ถ์์ ์ญ์ ๋๊ธฐ ์ StationPoint์ ๋๋ค.
- TArray <AStation*> StationPointBeforeRemovedStart;
- ๋ ธ์ ์์ ๋ถ๋ถ์์ ์ญ์ ๋๊ธฐ ์ StationPoint์ ๋๋ค.
- bool DoesStationsToBeRemovedAtStart;
- ๋ ธ์ ์์ ๋ถ๋ถ์์ ์ญ์ ๊ฐ ์์ฝ๋์๋์ง ํ์ธํฉ๋๋ค.
- bool DoesStationsToBeRemovedAtEnd;
- ๋ ธ์ ๋ ๋ถ๋ถ์์ ์ญ์ ๊ฐ ์์ฝ๋์๋์ง ํ์ธํฉ๋๋ค.
- bool DoesLaneToBeRemoved;
- ๋ ธ์ ์ ์ฒด ์ญ์ ๊ฐ ์์ฝ๋์๋์ง ํ์ธํฉ๋๋ค.
- TArray <AStation*> StationsToBeRemovedAtEnd;
- Function
- void FinishRemovingLaneAtStart();
- virtual void FinishRemovingLaneAtStart_Implementation();
- ์ญ์ ๋ ์ญ์ ํฅํ๋ ์ด์ฐจ์ ๊ฐ์๋ฅผ ๊ฒ์ฌํด ์์ ๋ถ๋ถ์ ์ญ์ ๋ฅผ ์งํํฉ๋๋ค.
- void FinishRemovingLaneAtEnd();
- virtual void FinishRemovingLaneAtEnd_Implementation();
- ์ญ์ ๋ ์ญ์ ํฅํ๋ ์ด์ฐจ์ ๊ฐ์๋ฅผ ๊ฒ์ฌํด ์์ ๋ถ๋ถ์ ์ญ์ ๋ฅผ ์งํํฉ๋๋ค.
- void FinishClearingLane();
- virtual void FinishClearingLane_Implementation();
- ๋ ธ์ ์ ์ด์ฐจ๋ฅผ ๊ฒ์ฌํด ๋ ธ์ ์ ์ฒด ์ญ์ ๋ฅผ ์งํํฉ๋๋ค.
- bool CheckTrainsByDestination(const TArray <class AStation*>& Stations);
- ๋ชฉ์ ์ง์ ์ถ๋ฐ์ง๋ก ํด๋น ์ญ์ ๋ฐ๋ ์ด์ฐจ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค.
- void NotifyTrainsOfRemoving(const TArray <class AStation*>& Stations);
- ์ฌ๋ผ์ง ๊ตฌ๊ฐ์ ์ด์ฐจ์ ์ญ์ ์๋ฆผ์ ๋ณด๋ ๋๋ค.
- void ModifyStationInfoWhenRemoving(const TArray <class AStation*>& Stations);
- ์ญ์ ๋๋ ๊ตฌ๊ฐ์ ์ญ์ ๋นํ์ฑํํ๊ณ ์ญ์ ์ ์ฅ๋ ๋ ธ์ ์ ์ญ์ ํฉ๋๋ค.
- TArray<class AStation*> CollectEveryStations();
- ์ญ์ ๋ ์ญ์ ๋ชจ๋ ๋ชจ์๋๋ค.
- void MarkLaneToRemoveFromStart(int32 Index);
- ์ญ์ ๋ ๋ ธ์ ์ ์์ ๋ถ๋ถ์ ํ์ํฉ๋๋ค.
- void MarkLaneToRemoveFromEnd(int32 Index,int32 ExStationNum);
- ์ญ์ ๋ ๋ ธ์ ์ ๋ ๋ถ๋ถ์ ํ์ํฉ๋๋ค.
- void MarkLaneToClear();
- ์ ์ฒด ๋ ธ์ ์ ์ญ์ ๋ฅผ ํ์ํฉ๋๋ค.
- Property
-
Train Related
- Function
- FIntPoint GetNextLocation(class ATrainTemplate* Train, FIntPoint CurLocation, TrainDirection Direction);
- ํด๋น ์ด์ฐจ์ ๋ค์ ๋ชฉ์ ์ง๋ฅผ ๋ฐํํฉ๋๋ค.
- TrainDirection SetDirectionInit(class AStation* Station, FIntPoint CurLocation) const;
- ๋ชฉํ์ญ๊ณผ ํ์ฌ ์์น๋ก ์ด์ฐจ์ ์ํ, ํํ์ ๊ฒฐ์ ํฉ๋๋ค.
- void SpawnTrain();
- ์๋ก ์์ฑ๋ ๋ ธ์ ์์ ์ด์ฐจ๋ฅผ ์์ฑํฉ๋๋ค.
- AStation* GetNextStation(AStation* CurrStation, TrainDirection Direction);
- ์ด์ฐจ์ ์งํ ๋ฐฉํฅ์ ์ด์ฉํด ๋ค์ ์ญ์ ๋ฐํํฉ๋๋ค.
- FIntPoint GetNextLocation(class ATrainTemplate* Train, FIntPoint CurLocation, TrainDirection Direction);
- Function
-
Change Appearance
- Property
- int32 PressedCount;
- ๋๋ธ ํด๋ฆญ์ ํ๋จํ๋ ํด๋ฆญ ํ์์ ๋๋ค.
- int32 PressedCount;
- Function
- void ChangeLaneAppearance(TArray AddLaneArray, int32 StartIndex, int32 EndIndex);
- ์ผ์ ๊ตฌ๊ฐ์ ๋ ธ์ ๋ชจ์์ ๋ฐ๊ฟ๋๋ค.
- void DoubleTapEvent(USplineMeshComponent* ClickedMesh);
- ๋๋ธ ํด๋ฆญ / ํฐ์น ์ด๋ฒคํธ๊ฐ ์ผ์ด๋๋ฉด ์คํ๋๋ ํจ์์ ๋๋ค.
- void CheckIsChangableLaneAppearance(TArray<AStation*> TargetStations);
- ๋ ธ์ ๋ชจ์์ ๋ณ๊ฒฝํ ์ ์์์ง ํ์ธํฉ๋๋ค.
- void CheckDoubleTap(ETouchIndex::Type FingerIndex, UPrimitiveComponent* TouchedComponent);
- ๋๋ธ ํฐ์น์ธ์ง ํ์ธํฉ๋๋ค.
- void CheckDoubleClick(UPrimitiveComponent* TouchedComponent, FKey ButtonPressed);
- ๋๋ธ ํด๋ฆญ์ธ์ง ํ์ธํฉ๋๋ค.
- void InitPressedCountDelay(ETouchIndex::Type FingerIndex, UPrimitiveComponent* TouchedComponent);
- ๋๋ธ ํฐ์น ํ๋จ์ ์ฌ์ฉ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
- void InitPressedCountDelayWithClick(UPrimitiveComponent* TouchedComponent, FKey ButtonReleased);
- ๋๋ธ ํด๋ฆญ ํ๋จ์ ์ฌ์ฉ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
- TArray<AStation*> GetConnectedStations(USplineMeshComponent* ClickedMesh);
- ์ธ์๋ SplineMeshcomponent๋ก ํด๋น ๊ตฌ๊ฐ์ ๋ฐํ๋ฐ์ต๋๋ค.
- void ChangeLaneAppearance(TArray AddLaneArray, int32 StartIndex, int32 EndIndex);
- Property
-
Delay Changing Appearance
- Property
- TArray<AStation*> ChangeAppearanceStations;
- ๋ ธ์ ๋ณ๊ฒฝ ๊ตฌ๊ฐ์ ์ ๋ ์ญ์ ๋๋ค.
- TArray<TArray> CurTunnelArea;
- ํ์ฌ ํฐ๋์ด ๋ฐฐ์น๋ ์์น๋ฅผ ๋ํ๋ ๋๋ค.
- TArray<TArray> CurBridgeArea;
- ํ์ฌ ๋ค๋ฆฌ๊ฐ ๋ฐฐ์น๋ ์์น๋ฅผ ๋ํ๋ ๋๋ค.
- TArray NewLaneArray;
- ์๋ก ๋ณ๊ฒฝํ ๋ ธ์ ๊ฒฝ๋ก๋ฅผ ๋ํ๋ ๋๋ค.
- int32 StartLaneArrayIndex;
- ๋ชจ์์ด ๋ฐ๋ ๊ตฌ๊ฐ์ ์์ ์ธ๋ฑ์ค์ ๋๋ค.
- int32 EndLaneArrayIndex;
- ๋ชจ์์ด ๋ฐ๋ ๊ตฌ๊ฐ์ ๋ ์ธ๋ฑ์ค์ ๋๋ค.
- bool AppearanceWillBeChanged;
- ์ง์ฐ ๋ชจ์ ๋ณ๊ฒฝ์ ์งํํ ์ง ๋ํ๋ ๋๋ค.
- TArray<AStation*> ChangeAppearanceStations;
- Function
- void InitDelayChangeAppearanceValues();
- ์ง์ฐ ๋ชจ์ ๋ณ๊ฒฝ์ ํ์ํ ๋ณ์๋ฅผ ๋ชจ๋ ์ ์ฅํ๋ ํจ์์ ๋๋ค.
- bool CheckTrainsByDestinationForChangeAppearance(const TArray <class AStation*>& Stations);
- ํด๋น ์ญ์ ๋ชฉํ์ญ์ผ๋ก ์ค์ ํ ์ด์ฐจ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค.
- void InitDelayChangeAppearanceValues();
- Property
-
Save & Load
- Property
- bool HasSaveFile;
- ์ธ์ด๋ธ ํ์ผ์ด ์๋์ง ๋ํ๋ ๋๋ค.
- bool HasSaveFile;
- Function
- void Save();
- ๊ฒ์ ์งํ ์ค ์ ์ฅํด์ผ ํ ๋ ธ์ ์ ์ ๋ณด๋ฅผ LaneSaveGame์ผ๋ก ์ ์ฅํฉ๋๋ค.
- bool Load();
- LaneSaveGame์ผ๋ก ์ ์ฅ๋ ํ์ผ์ ๋ถ๋ฌ์ Level์ ๋ถ๋ฌ์ต๋๋ค.
- void SpawnLaneMesh();
- LaneMesh๋ฅผ ์์ฑํฉ๋๋ค.
- void SetHasSaveFile(bool hasSave);
- ์ธ์ด๋ธ ํ์ผ ์กด์ฌ ์ฌ๋ถ๋ฅผ ์ค์ ํฉ๋๋ค.
- void Save();
- Property
-
Statistics
- Function
- void SubTotalLaneCount();
- ์ด ๋ ธ์ ์ ์๋ฅผ ๊ฐ์ํฉ๋๋ค.
- void AddTotalModifyAndDeleteCount();
- ๋ ธ์ ์ ์์ , ์ญ์ ํ์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
- void AddModifyAndReduceCountInEachLane();
- ๋ ธ์ ์ ์์ , ์ถ์ ํ์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
- void AddServiceStationCount(int32 Num);
- ์ดํ ์ค์ธ ์ญ์ ๊ฐ์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
- void SubServiceStationCount(int32 Num);
- ์ดํ ์ค์ธ ์ญ์ ๊ฐ์๋ฅผ ๊ฐ์ํฉ๋๋ค.
- float GetStationComplainAverage();
- ์ญ์ ํ๊ท ๋ถ๋ง๋๋ฅผ ๋ฐํํฉ๋๋ค.
- void InitializeCurrentLaneStatics();
- ํ์ฌ ๋ ธ์ ํต๊ณ๋ฅผ ์ด๊ธฐํํฉ๋๋ค.
- void UpdateUsingConnector();
- BridgeTunnel Item ์ฌ์ฉ ํ์๋ฅผ ๋ฐ์ํฉ๋๋ค.
- void SubTotalLaneCount();
- Function
-
2
- Property
- UClass* TrainClass = nullptr;
- USplineComponent* LaneSpline;
- USplineComponent* ReverseSpline;
- Property
-
3
- Property
- TArray<UMaterial*> LaneMaterial;
- FString LaneDefaultMaterialPath;
- FString LanedHandleMeshPath
- TArray<UMaterial*> RemoveLaneMaterial;
- TArray RemoveLanePath
- bool AlreadyDeleted = false;
- FTimerHandle SpawnTrainCheckTimer;
- bool IsStartHandleEditing = false;
- bool IsEndHandleEditing = false;
- Property
-
4
- Function
- void InitLaneMaterial(TArray<UMaterial*> Materials);
- FLanePoint GetNearestLanePoint(FVector Location);
- LaneDirection GetLaneShape(FVector Location);
- bool GetAlreadyDeleted() const;
- void SetAlreadyDeleted(bool _Delete);
- void StopHandleEditing();
- Function
-
5
- Function
- void CheckStationPoint();
- void SetBendingPoint();
- bool FindBendingPoint(FIntPoint& TargetPoint,FIntPoint PointStart, FIntPoint PointEnd);
- void FillLanePoint();
- void LaneCreating();
- virtual void LaneCreating_Implementation();
- void InitializeNewLane();
- virtual void InitializeNewLane_Implementation();
- void RemoveLane();
- virtual void RemoveLane_Implementation();
- void ExtendLane(class AStation* Station);
- virtual void ExtendLane_Implementation(class AStation* Station);
- Function
-
9
- Function
- void SetGridLaneStructure();
- void AddAdjListDistance(AStation* First, AStation* Second);
- FIntPoint GetWorldCoordinationByStationPointIndex(int32 Index);
- Function
-
10
- Property
- TArray PointArray;
- Function
- void SetLaneArray(const TArray<class AStation*>& NewStationPoint);
- Property
-
11
- Function
- bool HasBendingPoint(FIntPoint CurrentStation, FIntPoint NextStation);
- bool HasBendingPoint(FIntPoint Diff);
- FIntPoint FindBendingPoint(FIntPoint CurrentStation, FIntPoint NextStation);
- TArray GeneratePath(const FIntPoint& Start, const FIntPoint& End);
- void AddLanePoint(const FIntPoint& Point, bool IsStation, bool IsBendingPoint, TArray& TargetArray);
- void AddLanePoint(const FIntPoint& Point, bool IsStation, bool IsBendingPoint, TArray& TargetArray, int32 LanePosition);
- Function
-
12
- Property
- TArray LaneLocation;
- double SectionLength = 100;
- int32 EndLoop;
- Function
- void SetLaneLocation();
- FVector PointToLocation(const FIntPoint& Point);
- void ClearLanePoint();
- void SetLaneSpline();
- Property
-
13
- Property
- UMaterialInterface* MeshMaterial;
- UMaterialInterface* RemoveMeshMaterial;
- Function
- void SetMeshMaterial();
- void ChangeRemoveMaterialAtIndex(int32 Index);
- void SetSplineMeshes();
- Property
-
14
- Property
- UStaticMesh* LaneMesh;
- UStaticMesh* ThroughMesh;
- UStaticMeshComponent* StartHandle;
- UStaticMeshComponent* EndHandle;
- Function
- void InitHandles();
- void SetHandleMaterial();
- void SetHandleTransform();
- void SetMesh(UStaticMesh* Mesh, UStaticMesh* Through);
- void RemoveLaneFromStart(int32 Index);
- void ClearSplineMeshAt(int32 Index);
- void RemoveLaneFromEnd(int32 Index, int32 ExStationNum);
- void ExtendStart(AStation* NewStation);
- void ExtendEnd(AStation* NewStation);
- Property
-
17
- Function
- bool IsStationsValid(const TArray<class AStation*>& NewStationPoint);
- void DisconnectBT(TArray<TArray> Area, GridType Type);
- void ConnectBT(TArray<TArray> Area, GridType Type);
- TArray<TArray> GetArea(const TArray& LaneBlock, GridType Type);
- void SetArea(const TArray& Points, TArray<TArray>& AreaArray);
- bool IsBuildble(TArray& LaneBlock);
- TArray<TArray> GetConnectorArea(TArray& LaneBlock, GridType type);
- int32 GetRequiredConnector(TArray<TArray>& AreaArray, GridType type);
- ConnectorType GetConnectorType(GridType Type);
- Function
-
18
- Function
- TArray GetLanePath(AStation* StartStation, AStation* EndStation);
- TArray GetLanePathByPoint(FIntPoint StartStation, FIntPoint EndStation);
- void GetLaneArrays(FIntPoint StartStationCoord, FIntPoint AddedStationCoord, TArray& PreLaneArray);
- void SetMeshByIndex(int32 StartIndex, int32 LastIndex);
- void SetSplineMeshComponent(USplineMeshComponent* SplineMeshComponent, UStaticMesh* SplineMesh, int32 Index, int32 Pos);
- void SetSplineMeshComponent(FVector StartPos, FVector StartTangent, FVector EndPos, FVector EndTangent, int32 Index, int32 Pos);
- FVector LineIntersection(FVector A, FVector B, FVector C, FVector D);
- float CalculateOffset(int32 LanePosition);
- FVector CalculateLineDirection(FVector Vector1, FVector Vector2);
- FVector CalculatePerpendicular(FVector LineDirection, float Offset, float off);
- FVector ChangePerpendicularToStandard(FVector Perpendicular);
- void UpdateLocationAndSpline();
- void GetLaneArray(const TArray<class AStation*>& NewStationPoint, TArray& PreLaneArray);
- Function
-
19
- Function
- bool CheckExtendable(FIntPoint StartingStationCoordinate, FIntPoint AddedStationCoordinate);
- void InitLaneSpline();
- Function
-
22
- Property
- int32 UsingBridgeCount;
- int32 UsingTunnelCount;
- Property