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. ๋…ธ์„ ์„ ์—ฐ์žฅํ•ฉ๋‹ˆ๋‹ค.

์ด๋Ÿฌํ•œ ํฐ ์ค„๊ธฐ์— ๋ช‡ ๊ฐ€์ง€ ์กฐ๊ฑด์ด ๋” ๋ถ™์Šต๋‹ˆ๋‹ค.

๋…ธ์„ ์„ ์—ฐ์žฅํ•  ๋•Œ ๋‹ค๋ฆฌ/ํ„ฐ๋„ ์•„์ดํ…œ ๊ฐœ์ˆ˜๋ฅผ ํ™•์ธํ•˜๊ณ , ์‚ญ์ œ๋  ๋…ธ์„ ์— ์—ด์ฐจ๊ฐ€ ์žˆ๋‹ค๋ฉด ์ง€์—ฐ ์‚ญ์ œ๋ฅผ ์˜ˆ์•ฝํ•ฉ๋‹ˆ๋‹ค.

๋…ธ์„  ๋‚ด๋ถ€์—์„œ ์—ฐ์žฅ/์ถ•์†Œ ์ž‘์—…์„ ํ•œ ๋’ค์—๋Š” ๋ˆˆ์— ๋ณด์ด๋Š” ๋ถ€๋ถ„์„ ์—ฐ์žฅ/์ถ•์†Œ ์‹œํ‚ต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ํ•ธ๋“ค๋„ ๋ฐ”๋€ ๋…ธ์„ ์— ๋งž๊ฒŒ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค.

๊ฒฝ๋กœ ๊ณ„์‚ฐ(TODO)

๋…ธ์„  ์Šคํ”Œ๋ผ์ธ ๊ตฌํ˜„(TODO)

๋‹ค๋ฆฌ/ํ„ฐ๋„ ์•„์ดํ…œ ๊ฐœ์ˆ˜ ํ™•์ธ(TODO)

์ง€์—ฐ ์‚ญ์ œ

๋…ธ์„  ์ถ•์†Œ/์‚ญ์ œ๋ฅผ ํ•  ๋•Œ ์—ด์ฐจ๊ฐ€ ๊ทธ ๊ตฌ๊ฐ„์„ ์ง€๋‚˜๊ฐˆ ๋•Œ ๋ฐ”๋กœ ์‚ญ์ œ๋œ๋‹ค๋ฉด ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋ž˜์„œ ์œ„์˜ ๊ฒฝ์šฐ ํ•ด๋‹น ๊ตฌ๊ฐ„์„ ์‚ญ์ œ๋  ๊ตฌ๊ฐ„์œผ๋กœ ๋งŒ๋“ค๊ณ  ์—ด์ฐจ๊ฐ€ ์ง€๋‚˜๊ฐ€๋ฉด ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

์—ญ์„ ์ €์žฅํ•˜๋Š” 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๋กœ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

LaneManager

  • 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;
      • ํ˜„์žฌ ์„ ํƒ๋œ ์—ญ์˜ ํฌ์ธํ„ฐ๋ฅผ ๋‹ด์€ ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.
  • 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์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

Lane ํ•จ์ˆ˜

  • PopHandle

    • Property
      • static FOnPopHandleCalled OnPopHandleCalled;
      • bool CurrentlyPoppingLane;
    • Function
      • virtual void PopHandle(bool isUp) override;
      • void OnOtherLanePopHandleCalled(bool isUp);
  • Lane Information

    • Property
      • int32 LaneId;
        • ๋…ธ์„ ์˜ ๋ฒˆํ˜ธ์ž…๋‹ˆ๋‹ค.
      • bool IsCircularLine;
        • ์ˆœํ™˜์„  ์—ฌ๋ถ€๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
      • TArray<class AStation*> StationPoint;
        • ๋…ธ์„ ์ด ๊ฐ€์ง„ ์—ญ์˜ ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.
      • TArray LaneArray;
        • ๋…ธ์„ ์ด ๊ฐ€์ง„ ๊ทธ๋ฆฌ๋“œ ์ƒ์˜ ์ง€์ ์ž…๋‹ˆ๋‹ค.
    • Function
      • int32 GetLaneId();
        • ๋…ธ์„  ๋ฒˆํ˜ธ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
      • void SetLaneId(int _LaneId);
        • ๋…ธ์„  ๋ฒˆํ˜ธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
      • bool GetIsCircularLine();
        • ์ˆœํ™˜์„  ์—ฌ๋ถ€๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
      • void SetIsCircularLine(bool _Circular);
        • ์ˆœํ™˜์„  ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
  • Delay Removing

    • Property
      • TArray <AStation*> StationsToBeRemovedAtEnd;
        • ๋…ธ์„ ์˜ ๋ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๋  ์—ญ์ž…๋‹ˆ๋‹ค.
      • TArray <AStation*> StationsToBeRemovedAtStart;
        • ๋…ธ์„ ์˜ ์‹œ์ž‘ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๋  ์—ญ์ž…๋‹ˆ๋‹ค.
      • TArray <AStation*> StationPointBeforeRemovedEnd;
        • ๋…ธ์„  ๋ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๋˜๊ธฐ ์ „ StationPoint์ž…๋‹ˆ๋‹ค.
      • TArray <AStation*> StationPointBeforeRemovedStart;
        • ๋…ธ์„  ์‹œ์ž‘ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๋˜๊ธฐ ์ „ StationPoint์ž…๋‹ˆ๋‹ค.
      • bool DoesStationsToBeRemovedAtStart;
        • ๋…ธ์„  ์‹œ์ž‘ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๊ฐ€ ์˜ˆ์•ฝ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
      • bool DoesStationsToBeRemovedAtEnd;
        • ๋…ธ์„  ๋ ๋ถ€๋ถ„์—์„œ ์‚ญ์ œ๊ฐ€ ์˜ˆ์•ฝ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
      • bool DoesLaneToBeRemoved;
        • ๋…ธ์„  ์ „์ฒด ์‚ญ์ œ๊ฐ€ ์˜ˆ์•ฝ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
    • 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();
        • ์ „์ฒด ๋…ธ์„ ์˜ ์‚ญ์ œ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  • 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);
        • ์—ด์ฐจ์˜ ์ง„ํ–‰ ๋ฐฉํ–ฅ์„ ์ด์šฉํ•ด ๋‹ค์Œ ์—ญ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  • Change Appearance

    • Property
      • 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๋กœ ํ•ด๋‹น ๊ตฌ๊ฐ„์„ ๋ฐ˜ํ™˜๋ฐ›์Šต๋‹ˆ๋‹ค.
  • Delay Changing Appearance

    • Property
      • TArray<AStation*> ChangeAppearanceStations;
        • ๋…ธ์„  ๋ณ€๊ฒฝ ๊ตฌ๊ฐ„์˜ ์–‘ ๋ ์—ญ์ž…๋‹ˆ๋‹ค.
      • TArray<TArray> CurTunnelArea;
        • ํ˜„์žฌ ํ„ฐ๋„์ด ๋ฐฐ์น˜๋œ ์œ„์น˜๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
      • TArray<TArray> CurBridgeArea;
        • ํ˜„์žฌ ๋‹ค๋ฆฌ๊ฐ€ ๋ฐฐ์น˜๋œ ์œ„์น˜๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
      • TArray NewLaneArray;
        • ์ƒˆ๋กœ ๋ณ€๊ฒฝํ•  ๋…ธ์„  ๊ฒฝ๋กœ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
      • int32 StartLaneArrayIndex;
        • ๋ชจ์–‘์ด ๋ฐ”๋€” ๊ตฌ๊ฐ„์˜ ์‹œ์ž‘ ์ธ๋ฑ์Šค์ž…๋‹ˆ๋‹ค.
      • int32 EndLaneArrayIndex;
        • ๋ชจ์–‘์ด ๋ฐ”๋€” ๊ตฌ๊ฐ„์˜ ๋ ์ธ๋ฑ์Šค์ž…๋‹ˆ๋‹ค.
      • bool AppearanceWillBeChanged;
        • ์ง€์—ฐ ๋ชจ์–‘ ๋ณ€๊ฒฝ์„ ์ง„ํ–‰ํ• ์ง€ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
    • Function
      • void InitDelayChangeAppearanceValues();
        • ์ง€์—ฐ ๋ชจ์–‘ ๋ณ€๊ฒฝ์— ํ•„์š”ํ•œ ๋ณ€์ˆ˜๋ฅผ ๋ชจ๋‘ ์ €์žฅํ•˜๋Š” ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.
      • bool CheckTrainsByDestinationForChangeAppearance(const TArray <class AStation*>& Stations);
        • ํ•ด๋‹น ์—ญ์„ ๋ชฉํ‘œ์—ญ์œผ๋กœ ์„ค์ •ํ•œ ์—ด์ฐจ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  • Save & Load

    • Property
      • bool HasSaveFile;
        • ์„ธ์ด๋ธŒ ํŒŒ์ผ์ด ์žˆ๋Š”์ง€ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
    • Function
      • void Save();
        • ๊ฒŒ์ž„ ์ง„ํ–‰ ์ค‘ ์ €์žฅํ•ด์•ผ ํ•  ๋…ธ์„ ์˜ ์ •๋ณด๋ฅผ LaneSaveGame์œผ๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
      • bool Load();
        • LaneSaveGame์œผ๋กœ ์ €์žฅ๋œ ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์™€ Level์— ๋ถˆ๋Ÿฌ์˜ต๋‹ˆ๋‹ค.
      • void SpawnLaneMesh();
        • LaneMesh๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
      • void SetHasSaveFile(bool hasSave);
        • ์„ธ์ด๋ธŒ ํŒŒ์ผ ์กด์žฌ ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
  • Statistics

    • Function
      • void SubTotalLaneCount();
        • ์ด ๋…ธ์„ ์˜ ์ˆ˜๋ฅผ ๊ฐ์†Œํ•ฉ๋‹ˆ๋‹ค.
      • void AddTotalModifyAndDeleteCount();
        • ๋…ธ์„ ์˜ ์ˆ˜์ •, ์‚ญ์ œ ํšŸ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
      • void AddModifyAndReduceCountInEachLane();
        • ๋…ธ์„ ์˜ ์ˆ˜์ •, ์ถ•์†Œ ํšŸ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
      • void AddServiceStationCount(int32 Num);
        • ์šดํ–‰ ์ค‘์ธ ์—ญ์˜ ๊ฐœ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
      • void SubServiceStationCount(int32 Num);
        • ์šดํ–‰ ์ค‘์ธ ์—ญ์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ฐ์†Œํ•ฉ๋‹ˆ๋‹ค.
      • float GetStationComplainAverage();
        • ์—ญ์˜ ํ‰๊ท  ๋ถˆ๋งŒ๋„๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
      • void InitializeCurrentLaneStatics();
        • ํ˜„์žฌ ๋…ธ์„  ํ†ต๊ณ„๋ฅผ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
      • void UpdateUsingConnector();
        • BridgeTunnel Item ์‚ฌ์šฉ ํšŸ์ˆ˜๋ฅผ ๋ฐ˜์˜ํ•ฉ๋‹ˆ๋‹ค.

  • 2

    • Property
      • UClass* TrainClass = nullptr;
      • USplineComponent* LaneSpline;
      • USplineComponent* ReverseSpline;
  • 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;
  • 4

    • Function
      • void InitLaneMaterial(TArray<UMaterial*> Materials);
      • FLanePoint GetNearestLanePoint(FVector Location);
      • LaneDirection GetLaneShape(FVector Location);
      • bool GetAlreadyDeleted() const;
      • void SetAlreadyDeleted(bool _Delete);
      • void StopHandleEditing();
  • 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);
  • 9

    • Function
      • void SetGridLaneStructure();
      • void AddAdjListDistance(AStation* First, AStation* Second);
      • FIntPoint GetWorldCoordinationByStationPointIndex(int32 Index);
  • 10

    • Property
      • TArray PointArray;
    • Function
      • void SetLaneArray(const TArray<class AStation*>& NewStationPoint);
  • 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);
  • 12

    • Property
      • TArray LaneLocation;
      • double SectionLength = 100;
      • int32 EndLoop;
    • Function
      • void SetLaneLocation();
      • FVector PointToLocation(const FIntPoint& Point);
      • void ClearLanePoint();
      • void SetLaneSpline();
  • 13

    • Property
      • UMaterialInterface* MeshMaterial;
      • UMaterialInterface* RemoveMeshMaterial;
    • Function
      • void SetMeshMaterial();
      • void ChangeRemoveMaterialAtIndex(int32 Index);
      • void SetSplineMeshes();
  • 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);
  • 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);
  • 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);
  • 19

    • Function
      • bool CheckExtendable(FIntPoint StartingStationCoordinate, FIntPoint AddedStationCoordinate);
      • void InitLaneSpline();
  • 22

    • Property
      • int32 UsingBridgeCount;
      • int32 UsingTunnelCount;
โš ๏ธ **GitHub.com Fallback** โš ๏ธ