├── .gitattributes ├── .gitignore ├── BuildWithoutCooking.bat ├── Config ├── DefaultEditor.ini ├── DefaultEngine.ini ├── DefaultGame.ini └── DefaultInput.ini ├── Content ├── Development │ ├── GameInstance │ │ └── BP_GameInstance.uasset │ ├── GameModes │ │ ├── BP_Lobby-GameMode.uasset │ │ └── BP_Race-GameMode.uasset │ ├── GameState │ │ └── BP_ProjectRGameState.uasset │ ├── Maps │ │ ├── MainMenu.umap │ │ ├── Tracks │ │ │ ├── FlatPlayground.umap │ │ │ └── Playground.umap │ │ └── lobby.umap │ ├── Materials │ │ ├── AntiGravityCenter.uasset │ │ ├── PrimaryJetCoat.uasset │ │ ├── Race-bar.png │ │ ├── Race-bar.uasset │ │ ├── RaceStartLineMaterial.uasset │ │ ├── SecondaryJetCoat.uasset │ │ ├── jetEngine.uasset │ │ ├── jetModelMaterial.uasset │ │ ├── jetPhysicsMeshMaterial.uasset │ │ ├── magnetMesh.uasset │ │ ├── startLineTexture.uasset │ │ ├── trackBoundsMeshMaterial.uasset │ │ └── trackDefaultMaterial.uasset │ ├── Models │ │ ├── ProjectRAssets10_jetModelCopy.uasset │ │ ├── ProjectRAssets10_jetPhysicsMesh.uasset │ │ ├── ProjectRAssets11_magnetBox.uasset │ │ ├── ProjectRAssets6_jetModelMesh.uasset │ │ ├── ProjectRAssets6_magnetBox.uasset │ │ ├── ProjectRAssets6_track.uasset │ │ ├── ProjectRAssets9_RoadMesh.uasset │ │ ├── jetMesh.uasset │ │ ├── magnetBox.uasset │ │ ├── phaseWallMesh.uasset │ │ ├── roadFloor.uasset │ │ ├── trackBounds3D.uasset │ │ ├── trackBoundsMesh.uasset │ │ ├── trackBoundsMesh2.uasset │ │ └── trackBoundsMesh3.uasset │ ├── Objects │ │ ├── BP_FinalLapPhase.uasset │ │ ├── BP_InitialLapPhase.uasset │ │ ├── BP_IntermediateLapPhase.uasset │ │ ├── BP_Jet.uasset │ │ └── BP_TrackGenerator.uasset │ ├── PlayerController │ │ └── BP_PlayerController.uasset │ ├── PlayerState │ │ └── BP_RacePlayerState.uasset │ └── UI │ │ ├── WBP_AnnouncerUI.uasset │ │ ├── WBP_AutoSettingsNotification.uasset │ │ ├── WBP_LanMultiplayerMenu.uasset │ │ ├── WBP_LobbyMenu.uasset │ │ ├── WBP_LocalMultiplayerMenu.uasset │ │ ├── WBP_MainMenu.uasset │ │ ├── WBP_PauseMenu.uasset │ │ ├── WBP_PlayerPositionRow.uasset │ │ ├── WBP_RacePlayerUI.uasset │ │ ├── WBP_RaceResultsUI.uasset │ │ ├── WBP_SingleplayerMenu.uasset │ │ ├── WBP_StringButtonScrollBox.uasset │ │ ├── WBP_StringHolderButton.uasset │ │ └── WBP_mapSelectorWidget.uasset ├── Objects │ └── TrackMaker │ │ ├── Materials │ │ └── Road.uasset │ │ ├── Props │ │ └── RoadMesh.uasset │ │ └── Textures │ │ ├── RoadTexture_BaseColor_Alpha.uasset │ │ └── RoadTexture_Normal_Alpha.uasset └── Tests │ ├── TestBlueprints │ ├── AnnouncerUIContainer.uasset │ ├── BP_BoundedTrackGeneratorMOCK.uasset │ ├── BP_FloorMeshActorTest.uasset │ ├── BP_GameModeAnnouncerUI.uasset │ ├── BP_GameModeJetMOCK.uasset │ ├── BP_GameModeMapSelector.uasset │ ├── BP_GameModePRPControllerRacePlayer.uasset │ ├── BP_GameModePlayerController.uasset │ ├── BP_GameModePlayerControllerMOCK.uasset │ ├── BP_GameModePlayerPRow.uasset │ ├── BP_GameModeRacePlayerState.uasset │ ├── BP_GameModeRacePlayerUI.uasset │ ├── BP_GameModeRaceResultsUI.uasset │ ├── BP_GameModeStringHolderButton.uasset │ ├── BP_GameModeStringScrollBox.uasset │ ├── BP_JetMOCK.uasset │ ├── BP_PlayerControllerMOCK.uasset │ ├── BP_RaceGameModeMOCK.uasset │ ├── PlayerPositionRowWidgetContainer.uasset │ ├── RacePlayerUIContainer.uasset │ ├── RaceResultsUIContainer.uasset │ ├── StringHolderButtonContainer.uasset │ ├── StringScrollBoxContainer.uasset │ └── mapSelectorWidgetContainer.uasset │ └── TestMaps │ ├── BoundedTrackGeneratorMOCKWorld.umap │ ├── JetMOCKTestWorld.umap │ ├── JetMOCKWithFloorNoGWorld.umap │ ├── VoidWorld-AnnouncerUIContainer.umap │ ├── VoidWorld-ControllerGameState.umap │ ├── VoidWorld-ControllerPlayerState.umap │ ├── VoidWorld-JetMOCKTest.umap │ ├── VoidWorld-MapSelectorContainer.umap │ ├── VoidWorld-PlayerController.umap │ ├── VoidWorld-PlayerControllerMOCK.umap │ ├── VoidWorld-PlayerPRowContainer.umap │ ├── VoidWorld-RaceGameMode.umap │ ├── VoidWorld-RaceGameModeMOCK.umap │ ├── VoidWorld-RacePlayerState.umap │ ├── VoidWorld-RacePlayerUIContainer.umap │ ├── VoidWorld-RaceResultsAndFriends.umap │ ├── VoidWorld-StringHolderContainer.umap │ ├── VoidWorld-StringScrollContainer.umap │ └── VoidWorld.umap ├── Jenkinsfile ├── Logical View.png ├── Project R - Videojuego basado en Unreal Engine 4_ES.pdf ├── ProjectR.uproject ├── README.md ├── Source ├── ProjectR.Target.cs ├── ProjectR │ ├── Private │ │ ├── GameInstance │ │ │ └── ProjectRGameInstance.cpp │ │ ├── GameMode │ │ │ ├── RaceGameMode.cpp │ │ │ └── RaceStages │ │ │ │ ├── RaceBeginningStage.cpp │ │ │ │ ├── RaceEndedStage.cpp │ │ │ │ ├── RacePreparationStage.cpp │ │ │ │ ├── RaceRunningStage.cpp │ │ │ │ └── RaceStage.cpp │ │ ├── GameState │ │ │ ├── LobbyGameState.cpp │ │ │ └── ProjectRGameState.cpp │ │ ├── Jet │ │ │ ├── AntiGravityComponent.cpp │ │ │ ├── DeloreanReplicationMachine.cpp │ │ │ ├── Jet.cpp │ │ │ ├── MotorDriveComponent.cpp │ │ │ ├── MotorStates │ │ │ │ ├── AcceleratingMotorState.cpp │ │ │ │ ├── MixedMotorState.cpp │ │ │ │ ├── MotorState.cpp │ │ │ │ ├── MotorStateManager.cpp │ │ │ │ ├── NeutralMotorState.cpp │ │ │ │ └── ReversingMotorState.cpp │ │ │ ├── SteerStates │ │ │ │ ├── CenterSteerState.cpp │ │ │ │ ├── LeftSteerState.cpp │ │ │ │ ├── RightSteerState.cpp │ │ │ │ ├── SteerState.cpp │ │ │ │ └── SteerStateManager.cpp │ │ │ └── SteeringComponent.cpp │ │ ├── LapManager │ │ │ └── LapManager.cpp │ │ ├── LapPhases │ │ │ ├── FinalLapPhase.cpp │ │ │ ├── InitialLapPhase.cpp │ │ │ ├── IntermediateLapPhase.cpp │ │ │ └── LapPhase.cpp │ │ ├── PlayerController │ │ │ └── ProjectRPlayerController.cpp │ │ ├── PlayerState │ │ │ └── RacePlayerState.cpp │ │ ├── Session │ │ │ └── SessionManager.cpp │ │ ├── Track │ │ │ ├── TrackGenerator.cpp │ │ │ └── TrackManager.cpp │ │ └── UI │ │ │ ├── AnnouncerUI.cpp │ │ │ ├── LanMultiplayerMenu.cpp │ │ │ ├── LobbyMenu.cpp │ │ │ ├── LocalMultiplayerMenu.cpp │ │ │ ├── MainMenu.cpp │ │ │ ├── MapSelectorWidget.cpp │ │ │ ├── Menu.cpp │ │ │ ├── PauseMenu.cpp │ │ │ ├── PlayerPositionRow.cpp │ │ │ ├── RacePlayerUI.cpp │ │ │ ├── RaceResultsUI.cpp │ │ │ ├── SingleplayerMenu.cpp │ │ │ ├── StringButtonScrollBox.cpp │ │ │ └── StringHolderButton.cpp │ ├── ProjectR.Build.cs │ ├── ProjectR.cpp │ ├── ProjectR.h │ └── Public │ │ ├── GameInstance │ │ └── ProjectRGameInstance.h │ │ ├── GameMode │ │ ├── RaceGameMode.h │ │ └── RaceStages │ │ │ ├── RaceBeginningStage.h │ │ │ ├── RaceEndedStage.h │ │ │ ├── RacePreparationStage.h │ │ │ ├── RaceRunningStage.h │ │ │ └── RaceStage.h │ │ ├── GameState │ │ ├── LobbyGameState.h │ │ └── ProjectRGameState.h │ │ ├── Jet │ │ ├── AntiGravityComponent.h │ │ ├── DeloreanReplicationMachine.h │ │ ├── Jet.h │ │ ├── MotorDriveComponent.h │ │ ├── MotorStates │ │ │ ├── AcceleratingMotorState.h │ │ │ ├── MixedMotorState.h │ │ │ ├── MotorState.h │ │ │ ├── MotorStateManager.h │ │ │ ├── NeutralMotorState.h │ │ │ └── ReversingMotorState.h │ │ ├── SteerStates │ │ │ ├── CenterSteerState.h │ │ │ ├── LeftSteerState.h │ │ │ ├── RightSteerState.h │ │ │ ├── SteerState.h │ │ │ └── SteerStateManager.h │ │ └── SteeringComponent.h │ │ ├── LapManager │ │ └── LapManager.h │ │ ├── LapPhases │ │ ├── FinalLapPhase.h │ │ ├── InitialLapPhase.h │ │ ├── IntermediateLapPhase.h │ │ └── LapPhase.h │ │ ├── PlayerController │ │ └── ProjectRPlayerController.h │ │ ├── PlayerState │ │ └── RacePlayerState.h │ │ ├── Session │ │ └── SessionManager.h │ │ ├── Track │ │ ├── TrackGenerator.h │ │ └── TrackManager.h │ │ └── UI │ │ ├── AnnouncerUI.h │ │ ├── LanMultiplayerMenu.h │ │ ├── LobbyMenu.h │ │ ├── LocalMultiplayerMenu.h │ │ ├── MainMenu.h │ │ ├── MapSelectorWidget.h │ │ ├── Menu.h │ │ ├── PauseMenu.h │ │ ├── PlayerPositionRow.h │ │ ├── RacePlayerUI.h │ │ ├── RaceResultsUI.h │ │ ├── SingleplayerMenu.h │ │ ├── StringButtonScrollBox.h │ │ └── StringHolderButton.h ├── ProjectREditor.Target.cs └── TestingModule │ ├── Testing │ ├── Commands │ │ ├── CommonPIECommands.cpp │ │ ├── CommonPIECommands.h │ │ ├── NetworkCommands.cpp │ │ ├── NetworkCommands.h │ │ ├── PlaceholderTestCommands.cpp │ │ └── PlaceholderTestCommands.h │ ├── Mocks │ │ ├── DeloreanReplicationMachineMOCK.cpp │ │ ├── DeloreanReplicationMachineMOCK.h │ │ ├── JetMOCK.cpp │ │ ├── JetMOCK.h │ │ ├── LapManagerMOCK.cpp │ │ ├── LapManagerMOCK.h │ │ ├── LapPhaseMOCK.cpp │ │ ├── LapPhaseMOCK.h │ │ ├── MotorStateManagerMOCK.cpp │ │ ├── MotorStateManagerMOCK.h │ │ ├── ProjectRPlayerControllerMOCK.cpp │ │ ├── ProjectRPlayerControllerMOCK.h │ │ ├── RaceBeginningStageMOCK.cpp │ │ ├── RaceBeginningStageMOCK.h │ │ ├── RaceGameModeMOCK.cpp │ │ ├── RaceGameModeMOCK.h │ │ ├── RaceRunningStageMOCK.cpp │ │ ├── RaceRunningStageMOCK.h │ │ ├── RaceStageMOCK.cpp │ │ ├── RaceStageMOCK.h │ │ ├── SessionManagerMOCK.cpp │ │ ├── SessionManagerMOCK.h │ │ ├── SteerStateManagerMOCK.cpp │ │ ├── SteerStateManagerMOCK.h │ │ ├── TrackGeneratorMOCK.cpp │ │ ├── TrackGeneratorMOCK.h │ │ ├── TrackManagerMOCK.cpp │ │ └── TrackManagerMOCK.h │ ├── TestBaseClasses │ │ ├── SimplePIETestBase.cpp │ │ └── SimplePIETestBase.h │ ├── Tests │ │ ├── AcceleratingMotorState │ │ │ ├── AcceleratingMotorStateTest.cpp │ │ │ ├── AcceleratingMotorStateTest.h │ │ │ ├── AcceleratingMotorStateTestCommands.cpp │ │ │ └── AcceleratingMotorStateTestCommands.h │ │ ├── AnnouncerUI │ │ │ ├── AnnouncerUITest.cpp │ │ │ └── AnnouncerUITest.h │ │ ├── CenterSteerState │ │ │ ├── CenterSteerStateTest.cpp │ │ │ └── CenterSteerStateTest.h │ │ ├── FinalLapPhase │ │ │ ├── FinalLapPhaseTest.cpp │ │ │ └── FinalLapPhaseTest.h │ │ ├── InitialLapPhase │ │ │ ├── InitialLapPhaseTest.cpp │ │ │ └── InitialLapPhaseTest.h │ │ ├── IntermediateLapPhaseTest │ │ │ ├── IntermediateLapPhaseTest.cpp │ │ │ └── IntermediateLapPhaseTest.h │ │ ├── Jet │ │ │ ├── JetTest.cpp │ │ │ ├── JetTest.h │ │ │ ├── JetTestCommands.cpp │ │ │ └── JetTestCommands.h │ │ ├── LanMultiplayerMenu │ │ │ ├── LanMultiplayerMenuTest.cpp │ │ │ ├── LanMultiplayerMenuTest.h │ │ │ ├── LanMultiplayerMenuTestCommands.cpp │ │ │ └── LanMultiplayerMenuTestCommands.h │ │ ├── LapManager │ │ │ ├── LapManagerTest.cpp │ │ │ ├── LapManagerTest.h │ │ │ ├── LapManagerTestCommands.cpp │ │ │ └── LapManagerTestCommands.h │ │ ├── LapPhase │ │ │ ├── LapPhaseTest.cpp │ │ │ ├── LapPhaseTest.h │ │ │ ├── LapPhaseTestCommands.cpp │ │ │ └── LapPhaseTestCommands.h │ │ ├── LeftSteerState │ │ │ ├── LeftSteerStateTest.cpp │ │ │ ├── LeftSteerStateTest.h │ │ │ ├── LeftSteerStateTestCommands.cpp │ │ │ └── LeftSteerStateTestCommands.h │ │ ├── LobbyGameState │ │ │ ├── LobbyGameStateTest.cpp │ │ │ ├── LobbyGameStateTest.h │ │ │ ├── LobbyGameStateTestCommands.cpp │ │ │ └── LobbyGameStateTestCommands.h │ │ ├── LobbyMenu │ │ │ ├── LobbyMenuTest.cpp │ │ │ ├── LobbyMenuTest.h │ │ │ ├── LobbyMenuTestCommands.cpp │ │ │ └── LobbyMenuTestCommands.h │ │ ├── LocalMultiplayerMenu │ │ │ ├── LocalMultiplayerMenuTest.cpp │ │ │ ├── LocalMultiplayerMenuTest.h │ │ │ ├── LocalMultiplayerMenuTestCommands.cpp │ │ │ └── LocalMultiplayerMenuTestCommands.h │ │ ├── MainMenu │ │ │ ├── MainMenuTest.cpp │ │ │ ├── MainMenuTest.h │ │ │ ├── MainMenuTestCommands.cpp │ │ │ └── MainMenuTestCommands.h │ │ ├── MapSelectorWidget │ │ │ ├── MapSelectorWidgetTest.cpp │ │ │ ├── MapSelectorWidgetTest.h │ │ │ ├── MapSelectorWidgetTestCommands.cpp │ │ │ └── MapSelectorWidgetTestCommands.h │ │ ├── MixedMotorState │ │ │ ├── MixedMotorStateTest.cpp │ │ │ ├── MixedMotorStateTest.h │ │ │ ├── MixedMotorStateTestCommands.cpp │ │ │ └── MixedMotorStateTestCommands.h │ │ ├── MotorStateManager │ │ │ ├── MotorStateManagerTest.cpp │ │ │ ├── MotorStateManagerTest.h │ │ │ ├── MotorStateManagerTestCommands.cpp │ │ │ └── MotorStateManagerTestCommands.h │ │ ├── NeutralMotorState │ │ │ ├── NeutralMotorStateTest.cpp │ │ │ └── NeutralMotorStateTest.h │ │ ├── PauseMenu │ │ │ ├── PauseMenuTest.cpp │ │ │ ├── PauseMenuTest.h │ │ │ ├── PauseMenuTestCommands.cpp │ │ │ └── PauseMenuTestCommands.h │ │ ├── PlaceholderTest.cpp │ │ ├── PlaceholderTest.h │ │ ├── PlayerPositionRow │ │ │ ├── PlayerPositionRowTest.cpp │ │ │ ├── PlayerPositionRowTest.h │ │ │ ├── PlayerPositionRowTestCommands.cpp │ │ │ └── PlayerPositionRowTestCommands.h │ │ ├── ProjectRGameInstance │ │ │ ├── ProjectRGameInstanceTest.cpp │ │ │ ├── ProjectRGameInstanceTest.h │ │ │ ├── ProjectRGameInstanceTestCommands.cpp │ │ │ └── ProjectRGameInstanceTestCommands.h │ │ ├── ProjectRGameState │ │ │ ├── ProjectRGameStateTest.cpp │ │ │ ├── ProjectRGameStateTest.h │ │ │ ├── ProjectRGameStateTestCommands.cpp │ │ │ └── ProjectRGameStateTestCommands.h │ │ ├── ProjectRPlayerController │ │ │ ├── PrRPlayerControllerTestCommands.cpp │ │ │ ├── PrRPlayerControllerTestCommands.h │ │ │ ├── ProjectRPlayerControllerTest.cpp │ │ │ └── ProjectRPlayerControllerTest.h │ │ ├── RaceBeginningStage │ │ │ ├── RaceBeginningStageTest.cpp │ │ │ ├── RaceBeginningStageTest.h │ │ │ ├── RaceBeginningStageTestCommands.cpp │ │ │ └── RaceBeginningStageTestCommands.h │ │ ├── RaceEndedStage │ │ │ ├── RaceEndedStageTest.cpp │ │ │ └── RaceEndedStageTest.h │ │ ├── RaceGameMode │ │ │ ├── RaceGameModeTest.cpp │ │ │ ├── RaceGameModeTest.h │ │ │ ├── RaceGameModeTestCommands.cpp │ │ │ └── RaceGameModeTestCommands.h │ │ ├── RacePlayerState │ │ │ ├── RacePlayerStateTest.cpp │ │ │ ├── RacePlayerStateTest.h │ │ │ ├── RacePlayerStateTestCommands.cpp │ │ │ └── RacePlayerStateTestCommands.h │ │ ├── RacePlayerUI │ │ │ ├── RacePlayerUITest.cpp │ │ │ ├── RacePlayerUITest.h │ │ │ ├── RacePlayerUITestCommands.cpp │ │ │ └── RacePlayerUITestCommands.h │ │ ├── RacePreparationStage │ │ │ ├── RacePreparationStageTest.cpp │ │ │ ├── RacePreparationStageTest.h │ │ │ ├── RacePreparationStageTestCommands.cpp │ │ │ └── RacePreparationStageTestCommands.h │ │ ├── RaceResultsUI │ │ │ ├── RaceResultsUITest.cpp │ │ │ ├── RaceResultsUITest.h │ │ │ ├── RaceResultsUITestCommands.cpp │ │ │ └── RaceResultsUITestCommands.h │ │ ├── RaceRunningStage │ │ │ ├── RaceRunningStageTest.cpp │ │ │ ├── RaceRunningStageTest.h │ │ │ ├── RaceRunningStageTestCommands.cpp │ │ │ └── RaceRunningStageTestCommands.h │ │ ├── RaceStage │ │ │ ├── RaceStageTest.cpp │ │ │ ├── RaceStageTest.h │ │ │ ├── RaceStageTestCommands.cpp │ │ │ └── RaceStageTestCommands.h │ │ ├── ReversingMotorState │ │ │ ├── ReversingMotorStateTest.cpp │ │ │ ├── ReversingMotorStateTest.h │ │ │ ├── ReversingMotorStateTestCommands.cpp │ │ │ └── ReversingMotorStateTestCommands.h │ │ ├── RightSteerState │ │ │ ├── RightSteerStateTest.cpp │ │ │ ├── RightSteerStateTest.h │ │ │ ├── RightSteerStateTestCommands.cpp │ │ │ └── RightSteerStateTestCommands.h │ │ ├── SessionManager │ │ │ ├── SessionManagerTest.cpp │ │ │ ├── SessionManagerTest.h │ │ │ ├── SessionManagerTestCommands.cpp │ │ │ └── SessionManagerTestCommands.h │ │ ├── SingleplayerMenu │ │ │ ├── SingleplayerMenuTest.cpp │ │ │ ├── SingleplayerMenuTest.h │ │ │ ├── SingleplayerMenuTestCommands.cpp │ │ │ └── SingleplayerMenuTestCommands.h │ │ ├── SteerStateManager │ │ │ ├── SteerStateManagerTest.cpp │ │ │ ├── SteerStateManagerTest.h │ │ │ ├── SteerStateManagerTestCommands.cpp │ │ │ └── SteerStateManagerTestCommands.h │ │ ├── StringHolderButton │ │ │ ├── StringHolderButtonTest.cpp │ │ │ ├── StringHolderButtonTest.h │ │ │ ├── StringHolderButtonTestCommands.cpp │ │ │ └── StringHolderButtonTestCommands.h │ │ ├── StringScrollBox │ │ │ ├── StringScrollBoxTest.cpp │ │ │ ├── StringScrollBoxTest.h │ │ │ ├── StringScrollBoxTestCommands.cpp │ │ │ └── StringScrollBoxTestCommands.h │ │ ├── TrackGenerator │ │ │ ├── TrackGeneratorTest.cpp │ │ │ ├── TrackGeneratorTest.h │ │ │ ├── TrackGeneratorTestCommands.cpp │ │ │ └── TrackGeneratorTestCommands.h │ │ └── TrackManager │ │ │ ├── TrackManagerTest.cpp │ │ │ ├── TrackManagerTest.h │ │ │ ├── TrackManagerTestCommands.cpp │ │ │ └── TrackManagerTestCommands.h │ └── Utilities │ │ ├── BlueprintWidgetContainerPawn.cpp │ │ ├── BlueprintWidgetContainerPawn.h │ │ ├── NetworkedPIESessionUtilities.cpp │ │ ├── NetworkedPIESessionUtilities.h │ │ ├── ObjectContainerActor.cpp │ │ ├── ObjectContainerActor.h │ │ ├── PIESessionUtilities.cpp │ │ ├── PIESessionUtilities.h │ │ ├── floorMeshActor.cpp │ │ └── floorMeshActor.h │ ├── TestingModule.Build.cs │ ├── TestingModule.cpp │ └── TestingModule.h ├── TestRunner.bat └── TestRunnerAndCodeCoverage.bat /BuildWithoutCooking.bat: -------------------------------------------------------------------------------- 1 | set ue4Location=%~1 2 | set workspace=%~2 3 | set projectFilename=%~3 4 | 5 | 6 | "%ue4Location%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project="%workspace%\%projectFilename%" -noP4 -platform=Win64 -clientconfig=Development -build -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/HardwareTargeting.HardwareTargetingSettings] 4 | TargetedHardwareClass=Desktop 5 | AppliedTargetedHardwareClass=Desktop 6 | DefaultGraphicsPerformance=Maximum 7 | AppliedDefaultGraphicsPerformance=Maximum 8 | 9 | [/Script/Engine.Engine] 10 | +ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/ProjectR") 11 | +ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/ProjectR") 12 | +ActiveClassRedirects=(OldClassName="TP_BlankGameModeBase",NewClassName="ProjectRGameModeBase") 13 | 14 | [/Script/EngineSettings.GameMapsSettings] 15 | GameDefaultMap=/Game/Development/Maps/MainMenu.MainMenu 16 | EditorStartupMap=/Engine/Maps/Templates/Template_Default.Template_Default 17 | GameInstanceClass=/Game/Development/GameInstance/BP_GameInstance.BP_GameInstance_C 18 | bUseSplitscreen=True 19 | TwoPlayerSplitscreenLayout=Horizontal 20 | ThreePlayerSplitscreenLayout=Vertical 21 | bOffsetPlayerGamepadIds=True 22 | 23 | [OnlineSubsystem] 24 | DefaultPlatformService=Null 25 | 26 | [/Script/Engine.RendererSettings] 27 | r.EarlyZPass=2 28 | r.EarlyZPassOnlyMaterialMasking=True 29 | r.DBuffer=True 30 | 31 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | 2 | [/Script/EngineSettings.GeneralProjectSettings] 3 | ProjectID=43F8F20741E95FF3D7A472ACF5ADBCF9 4 | 5 | [/Script/UnrealEd.ProjectPackagingSettings] 6 | FullRebuild=False 7 | 8 | -------------------------------------------------------------------------------- /Content/Development/GameInstance/BP_GameInstance.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/GameInstance/BP_GameInstance.uasset -------------------------------------------------------------------------------- /Content/Development/GameModes/BP_Lobby-GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/GameModes/BP_Lobby-GameMode.uasset -------------------------------------------------------------------------------- /Content/Development/GameModes/BP_Race-GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/GameModes/BP_Race-GameMode.uasset -------------------------------------------------------------------------------- /Content/Development/GameState/BP_ProjectRGameState.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/GameState/BP_ProjectRGameState.uasset -------------------------------------------------------------------------------- /Content/Development/Maps/MainMenu.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Maps/MainMenu.umap -------------------------------------------------------------------------------- /Content/Development/Maps/Tracks/FlatPlayground.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Maps/Tracks/FlatPlayground.umap -------------------------------------------------------------------------------- /Content/Development/Maps/Tracks/Playground.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Maps/Tracks/Playground.umap -------------------------------------------------------------------------------- /Content/Development/Maps/lobby.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Maps/lobby.umap -------------------------------------------------------------------------------- /Content/Development/Materials/AntiGravityCenter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/AntiGravityCenter.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/PrimaryJetCoat.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/PrimaryJetCoat.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/Race-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/Race-bar.png -------------------------------------------------------------------------------- /Content/Development/Materials/Race-bar.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/Race-bar.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/RaceStartLineMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/RaceStartLineMaterial.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/SecondaryJetCoat.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/SecondaryJetCoat.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/jetEngine.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/jetEngine.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/jetModelMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/jetModelMaterial.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/jetPhysicsMeshMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/jetPhysicsMeshMaterial.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/magnetMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/magnetMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/startLineTexture.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/startLineTexture.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/trackBoundsMeshMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/trackBoundsMeshMaterial.uasset -------------------------------------------------------------------------------- /Content/Development/Materials/trackDefaultMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Materials/trackDefaultMaterial.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets10_jetModelCopy.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets10_jetModelCopy.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets10_jetPhysicsMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets10_jetPhysicsMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets11_magnetBox.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets11_magnetBox.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets6_jetModelMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets6_jetModelMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets6_magnetBox.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets6_magnetBox.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets6_track.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets6_track.uasset -------------------------------------------------------------------------------- /Content/Development/Models/ProjectRAssets9_RoadMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/ProjectRAssets9_RoadMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/jetMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/jetMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/magnetBox.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/magnetBox.uasset -------------------------------------------------------------------------------- /Content/Development/Models/phaseWallMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/phaseWallMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/roadFloor.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/roadFloor.uasset -------------------------------------------------------------------------------- /Content/Development/Models/trackBounds3D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/trackBounds3D.uasset -------------------------------------------------------------------------------- /Content/Development/Models/trackBoundsMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/trackBoundsMesh.uasset -------------------------------------------------------------------------------- /Content/Development/Models/trackBoundsMesh2.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/trackBoundsMesh2.uasset -------------------------------------------------------------------------------- /Content/Development/Models/trackBoundsMesh3.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Models/trackBoundsMesh3.uasset -------------------------------------------------------------------------------- /Content/Development/Objects/BP_FinalLapPhase.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Objects/BP_FinalLapPhase.uasset -------------------------------------------------------------------------------- /Content/Development/Objects/BP_InitialLapPhase.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Objects/BP_InitialLapPhase.uasset -------------------------------------------------------------------------------- /Content/Development/Objects/BP_IntermediateLapPhase.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Objects/BP_IntermediateLapPhase.uasset -------------------------------------------------------------------------------- /Content/Development/Objects/BP_Jet.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Objects/BP_Jet.uasset -------------------------------------------------------------------------------- /Content/Development/Objects/BP_TrackGenerator.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/Objects/BP_TrackGenerator.uasset -------------------------------------------------------------------------------- /Content/Development/PlayerController/BP_PlayerController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/PlayerController/BP_PlayerController.uasset -------------------------------------------------------------------------------- /Content/Development/PlayerState/BP_RacePlayerState.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/PlayerState/BP_RacePlayerState.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_AnnouncerUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_AnnouncerUI.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_AutoSettingsNotification.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_AutoSettingsNotification.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_LanMultiplayerMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_LanMultiplayerMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_LobbyMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_LobbyMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_LocalMultiplayerMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_LocalMultiplayerMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_MainMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_MainMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_PauseMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_PauseMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_PlayerPositionRow.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_PlayerPositionRow.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_RacePlayerUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_RacePlayerUI.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_RaceResultsUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_RaceResultsUI.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_SingleplayerMenu.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_SingleplayerMenu.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_StringButtonScrollBox.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_StringButtonScrollBox.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_StringHolderButton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_StringHolderButton.uasset -------------------------------------------------------------------------------- /Content/Development/UI/WBP_mapSelectorWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Development/UI/WBP_mapSelectorWidget.uasset -------------------------------------------------------------------------------- /Content/Objects/TrackMaker/Materials/Road.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Objects/TrackMaker/Materials/Road.uasset -------------------------------------------------------------------------------- /Content/Objects/TrackMaker/Props/RoadMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Objects/TrackMaker/Props/RoadMesh.uasset -------------------------------------------------------------------------------- /Content/Objects/TrackMaker/Textures/RoadTexture_BaseColor_Alpha.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Objects/TrackMaker/Textures/RoadTexture_BaseColor_Alpha.uasset -------------------------------------------------------------------------------- /Content/Objects/TrackMaker/Textures/RoadTexture_Normal_Alpha.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Objects/TrackMaker/Textures/RoadTexture_Normal_Alpha.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/AnnouncerUIContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/AnnouncerUIContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_BoundedTrackGeneratorMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_BoundedTrackGeneratorMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_FloorMeshActorTest.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_FloorMeshActorTest.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeAnnouncerUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeAnnouncerUI.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeJetMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeJetMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeMapSelector.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeMapSelector.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModePRPControllerRacePlayer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModePRPControllerRacePlayer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModePlayerController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModePlayerController.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModePlayerControllerMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModePlayerControllerMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModePlayerPRow.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModePlayerPRow.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeRacePlayerState.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeRacePlayerState.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeRacePlayerUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeRacePlayerUI.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeRaceResultsUI.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeRaceResultsUI.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeStringHolderButton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeStringHolderButton.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_GameModeStringScrollBox.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_GameModeStringScrollBox.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_JetMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_JetMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_PlayerControllerMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_PlayerControllerMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/BP_RaceGameModeMOCK.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/BP_RaceGameModeMOCK.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/PlayerPositionRowWidgetContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/PlayerPositionRowWidgetContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/RacePlayerUIContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/RacePlayerUIContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/RaceResultsUIContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/RaceResultsUIContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/StringHolderButtonContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/StringHolderButtonContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/StringScrollBoxContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/StringScrollBoxContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestBlueprints/mapSelectorWidgetContainer.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestBlueprints/mapSelectorWidgetContainer.uasset -------------------------------------------------------------------------------- /Content/Tests/TestMaps/BoundedTrackGeneratorMOCKWorld.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/BoundedTrackGeneratorMOCKWorld.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/JetMOCKTestWorld.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/JetMOCKTestWorld.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/JetMOCKWithFloorNoGWorld.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/JetMOCKWithFloorNoGWorld.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-AnnouncerUIContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-AnnouncerUIContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-ControllerGameState.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-ControllerGameState.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-ControllerPlayerState.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-ControllerPlayerState.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-JetMOCKTest.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-JetMOCKTest.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-MapSelectorContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-MapSelectorContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-PlayerController.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-PlayerController.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-PlayerControllerMOCK.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-PlayerControllerMOCK.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-PlayerPRowContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-PlayerPRowContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-RaceGameMode.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-RaceGameMode.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-RaceGameModeMOCK.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-RaceGameModeMOCK.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-RacePlayerState.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-RacePlayerState.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-RacePlayerUIContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-RacePlayerUIContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-RaceResultsAndFriends.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-RaceResultsAndFriends.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-StringHolderContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-StringHolderContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld-StringScrollContainer.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld-StringScrollContainer.umap -------------------------------------------------------------------------------- /Content/Tests/TestMaps/VoidWorld.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Content/Tests/TestMaps/VoidWorld.umap -------------------------------------------------------------------------------- /Logical View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Logical View.png -------------------------------------------------------------------------------- /Project R - Videojuego basado en Unreal Engine 4_ES.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Floating-Island/ProjectR/00ce9c26acd232883e1ba287ec328c508ffe1ff3/Project R - Videojuego basado en Unreal Engine 4_ES.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ProjectR 2 | Final Project for the Engineer's Degree 3 | 4 | A Futuristic 3D Racing Game to insert myself into the videogame industry. 5 | 6 | Here you'll find my own implementation of a Continuous Integration environment for Unreal Engine 4, that's triggered by GitHub Push and Pull Requests notifying a Jenkins pipeline. Jenkins then builds the project, runs all the project's tests and notifies the result of the job to the user via Slack. 7 | 8 | I learned to utilize the Unreal Automation Framework to create my own UE4 C++ tests (~340 tests), ranging from: 9 | - Simple testing of class object attributes. 10 | - Actor tests within a world (accelerating jets, testing anti-gravity, lap behaviour, race rules, controller interaction and so on). 11 | - UI tests (clicking menu buttons). 12 | - Simple replication (replication automating a networked PIE session with a server and a client). 13 | 14 | This also has the project's logical view and my thesis (in Spanish, sorry). 15 | 16 | I hope every player that plays it and programmer that reads it will enjoy it as much as I did while making it and playing with it :) 17 | -------------------------------------------------------------------------------- /Source/ProjectR.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class ProjectRTarget : TargetRules 7 | { 8 | public ProjectRTarget( TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Game; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | ExtraModuleNames.AddRange( new string[] { "ProjectR" } ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameMode/RaceStages/RaceBeginningStage.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameMode/RaceStages/RaceBeginningStage.h" 5 | 6 | #include "TimerManager.h" 7 | #include "PlayerController/ProjectRPlayerController.h" 8 | #include "GameMode/RaceStages/RaceRunningStage.h" 9 | #include "GameState/ProjectRGameState.h" 10 | 11 | 12 | void ARaceBeginningStage::loadAnnouncerOnControllers() 13 | { 14 | for (auto iterator = GetWorld()->GetPlayerControllerIterator(); iterator; ++iterator) 15 | { 16 | AProjectRPlayerController* controller = Cast(iterator->Get()); 17 | if(controller) 18 | { 19 | controller->loadAnnouncerUI(); 20 | } 21 | } 22 | } 23 | 24 | void ARaceBeginningStage::start() 25 | { 26 | loadAnnouncerOnControllers(); 27 | FTimerDelegate countdownDelegate = FTimerDelegate::CreateUObject(this, &ARaceBeginningStage::countdownToStart, 3); 28 | GetWorldTimerManager().SetTimer(countdownTimer, countdownDelegate, 1, false, 1.0f); 29 | } 30 | 31 | void ARaceBeginningStage::countdownToStart(int countdown) 32 | { 33 | AProjectRGameState* gameState = Cast(GetWorld()->GetGameState()); 34 | if (countdown <= 0) 35 | { 36 | gameState->updateAnnouncerWith(FString("GO!")); 37 | stageEndedEvent.Broadcast(this); 38 | return; 39 | } 40 | gameState->updateAnnouncerWith(FString::FromInt(countdown)); 41 | FTimerDelegate countdownDelegate = FTimerDelegate::CreateUObject(this, &ARaceBeginningStage::countdownToStart, --countdown); 42 | GetWorldTimerManager().SetTimer(countdownTimer, countdownDelegate, 1, false, 1.0f); 43 | } 44 | 45 | ARaceStage* ARaceBeginningStage::nextStage() 46 | { 47 | return GetWorld()->SpawnActor(); 48 | } -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameMode/RaceStages/RaceEndedStage.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameMode/RaceStages/RaceEndedStage.h" 5 | 6 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameMode/RaceStages/RacePreparationStage.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameMode/RaceStages/RacePreparationStage.h" 5 | 6 | #include "GameMode/RaceStages/RaceBeginningStage.h" 7 | #include "GameMode/RaceGameMode.h" 8 | 9 | void ARacePreparationStage::BeginPlay() 10 | { 11 | Super::BeginPlay(); 12 | } 13 | 14 | ARaceStage* ARacePreparationStage::nextStage() 15 | { 16 | return GetWorld()->SpawnActor(); 17 | } 18 | 19 | void ARacePreparationStage::start() 20 | { 21 | raceMode->achieveNecessaryPlayersQuantity(); 22 | raceMode->positionExpectedJets(); 23 | raceMode->possessJets(); 24 | raceMode->disableJetsInput(); 25 | raceMode->createLapManager(); 26 | stageEndedEvent.Broadcast(this); 27 | } 28 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameMode/RaceStages/RaceRunningStage.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameMode/RaceStages/RaceRunningStage.h" 5 | 6 | 7 | #include "PlayerController/ProjectRPlayerController.h" 8 | #include "GameMode/RaceStages/RaceEndedStage.h" 9 | #include "GameMode/RaceGameMode.h" 10 | 11 | void ARaceRunningStage::removeAnnouncersFromControllers() 12 | { 13 | for (auto iterator = GetWorld()->GetPlayerControllerIterator(); iterator; ++iterator) 14 | { 15 | AProjectRPlayerController* controller = Cast(iterator->Get()); 16 | if(controller) 17 | { 18 | controller->removeAnnouncerUI(); 19 | } 20 | } 21 | } 22 | 23 | ARaceStage* ARaceRunningStage::nextStage() 24 | { 25 | return GetWorld()->SpawnActor(); 26 | } 27 | 28 | void ARaceRunningStage::Tick(float DeltaSeconds) 29 | { 30 | Super::Super::Tick(DeltaSeconds); 31 | raceMode->updateJetPositions(); 32 | if (raceMode->jetsRacing().Num() == 0) 33 | { 34 | stageEndedEvent.Broadcast(this); 35 | } 36 | } 37 | 38 | void ARaceRunningStage::start() 39 | { 40 | FTimerDelegate removalDelegate = FTimerDelegate::CreateUObject(this, &ARaceRunningStage::removeAnnouncersFromControllers); 41 | GetWorldTimerManager().SetTimer(announcerRemovalDelay, removalDelegate, 2.5f, false, 1.0f); 42 | raceMode->enableJetsInput(); 43 | } 44 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameMode/RaceStages/RaceStage.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameMode/RaceStages/RaceStage.h" 5 | #include "GameMode/RaceGameMode.h" 6 | 7 | // Sets default values 8 | ARaceStage::ARaceStage() 9 | { 10 | // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. 11 | PrimaryActorTick.bCanEverTick = true; 12 | 13 | } 14 | 15 | // Called when the game starts or when spawned 16 | void ARaceStage::BeginPlay() 17 | { 18 | Super::BeginPlay(); 19 | raceMode = Cast(GetWorld()->GetAuthGameMode()); 20 | stageEndedEvent.AddDynamic(raceMode, &ARaceGameMode::updateStage); 21 | } 22 | 23 | // Called every frame 24 | void ARaceStage::Tick(float DeltaTime) 25 | { 26 | Super::Tick(DeltaTime); 27 | 28 | } 29 | 30 | ARaceStage* ARaceStage::nextStage() 31 | { 32 | return this; 33 | } 34 | 35 | void ARaceStage::start() 36 | { 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameState/LobbyGameState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameState/LobbyGameState.h" 5 | 6 | #include "UI/LobbyMenu.h" 7 | #include "Net/UnrealNetwork.h" 8 | 9 | void ALobbyGameState::fireLobbyMapUpdateEvent() 10 | { 11 | mapUpdateEvent.Broadcast(selectedMap); 12 | } 13 | 14 | void ALobbyGameState::updateSelectedMap(FString anUpdatedMap) 15 | { 16 | if(HasAuthority()) 17 | { 18 | selectedMap = anUpdatedMap; 19 | } 20 | } 21 | 22 | void ALobbyGameState::subscribeToLobbyMapUpdate(ULobbyMenu* aLobbyMenu) 23 | { 24 | mapUpdateEvent.AddUniqueDynamic(aLobbyMenu, &ULobbyMenu::updateSelectedMapText); 25 | fireLobbyMapUpdateEvent(); 26 | } 27 | 28 | FString ALobbyGameState::selectedMapName() 29 | { 30 | return selectedMap; 31 | } 32 | 33 | 34 | void ALobbyGameState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const 35 | { 36 | Super::GetLifetimeReplicatedProps(OutLifetimeProps); 37 | 38 | DOREPLIFETIME(ALobbyGameState, selectedMap); 39 | } 40 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/GameState/ProjectRGameState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "GameState/ProjectRGameState.h" 5 | 6 | 7 | #include "Net/UnrealNetwork.h" 8 | #include "UI/AnnouncerUI.h" 9 | #include "UI/RaceResultsUI.h" 10 | 11 | 12 | void AProjectRGameState::fireAnnouncerUpdateEvent() 13 | { 14 | announcerUpdateEvent.Broadcast(announcerText); 15 | } 16 | 17 | void AProjectRGameState::subscribeToAnnouncerUpdate(UAnnouncerUI* anAnnouncerUI) 18 | { 19 | announcerUpdateEvent.AddUniqueDynamic(anAnnouncerUI, &UAnnouncerUI::modifyWith); 20 | } 21 | 22 | void AProjectRGameState::updateAnnouncerWith(FString aText) 23 | { 24 | announcerText = aText; 25 | fireAnnouncerUpdateEvent(); 26 | } 27 | 28 | FString AProjectRGameState::announcerDisplayText() 29 | { 30 | return announcerText; 31 | } 32 | 33 | UClass* AProjectRGameState::announcerUIType() 34 | { 35 | return announcerUIClass; 36 | } 37 | 38 | void AProjectRGameState::fireEvents() 39 | { 40 | fireAnnouncerUpdateEvent(); 41 | } 42 | 43 | UClass* AProjectRGameState::resultsUIType() 44 | { 45 | return resultsUIClass; 46 | } 47 | 48 | void AProjectRGameState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const 49 | { 50 | Super::GetLifetimeReplicatedProps(OutLifetimeProps); 51 | 52 | DOREPLIFETIME(AProjectRGameState, announcerText ); 53 | } 54 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/AcceleratingMotorState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/AcceleratingMotorState.h" 5 | #include "Jet/MotorDriveComponent.h" 6 | #include "Jet/Jet.h" 7 | 8 | void UAcceleratingMotorState::activate(UMotorDriveComponent* aMotorDriveComponent) 9 | { 10 | aMotorDriveComponent->accelerate(); 11 | } 12 | 13 | FVector UAcceleratingMotorState::linearAccelerationsGeneratedTo(AJet* aJet) 14 | { 15 | if(aJet->currentSpeed() < aJet->settedTopSpeed() && !FMath::IsNearlyEqual(aJet->currentSpeed(), aJet->settedTopSpeed(), 1.0f)) 16 | { 17 | return aJet->acceleration() * aJet->ForwardProjectionOnFloor(); 18 | } 19 | return FVector(0); 20 | } 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/MixedMotorState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/MixedMotorState.h" 5 | #include "Jet/MotorDriveComponent.h" 6 | #include "Jet/Jet.h" 7 | 8 | void UMixedMotorState::activate(UMotorDriveComponent* aMotorDriveComponent) 9 | { 10 | aMotorDriveComponent->accelerate(); 11 | aMotorDriveComponent->brake(); 12 | } 13 | 14 | FVector UMixedMotorState::linearAccelerationsGeneratedTo(AJet* aJet) 15 | { 16 | if(aJet->currentSpeed() < aJet->settedTopSpeed() && !FMath::IsNearlyEqual(aJet->currentSpeed(), aJet->settedTopSpeed(), 1.0f)) 17 | { 18 | return (aJet->acceleration() - aJet->brakeValue()) * aJet->ForwardProjectionOnFloor(); 19 | } 20 | return FVector(0); 21 | } 22 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/MotorState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/MotorState.h" 5 | 6 | 7 | // Sets default values 8 | UMotorState::UMotorState() 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/MotorStateManager.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/MotorStateManager.h" 5 | 6 | 7 | #include "Jet/MotorStates/NeutralMotorState.h" 8 | #include "Jet/MotorStates/AcceleratingMotorState.h" 9 | #include "Jet/MotorStates/ReversingMotorState.h" 10 | #include "Jet/MotorStates/MixedMotorState.h" 11 | 12 | // Sets default values 13 | AMotorStateManager::AMotorStateManager() 14 | { 15 | PrimaryActorTick.bCanEverTick = false; 16 | motorState = nullptr; 17 | } 18 | 19 | void AMotorStateManager::PostInitializeComponents() 20 | { 21 | Super::PostInitializeComponents(); 22 | updateStateTo(); 23 | owningJet = Cast(GetOwner()); 24 | } 25 | 26 | // Called when the game starts or when spawned 27 | void AMotorStateManager::BeginPlay() 28 | { 29 | Super::BeginPlay(); 30 | } 31 | 32 | void AMotorStateManager::activate(UMotorDriveComponent* aMotorDrive) 33 | { 34 | motorState->activate(aMotorDrive); 35 | } 36 | 37 | UClass* AMotorStateManager::stateClass() 38 | { 39 | return motorState->GetClass(); 40 | } 41 | 42 | void AMotorStateManager::overrideStateTo(UClass* anotherState, AJet* owner) 43 | { 44 | if(owningJet == owner) 45 | { 46 | motorState = nullptr; 47 | motorState = NewObject(this, anotherState, anotherState->GetFName()); 48 | } 49 | } 50 | 51 | void AMotorStateManager::accelerate() 52 | { 53 | makeMotorStateBe(); 54 | } 55 | 56 | void AMotorStateManager::brake() 57 | { 58 | makeMotorStateBe(); 59 | } 60 | 61 | void AMotorStateManager::neutralize() 62 | { 63 | makeMotorStateBe(); 64 | } 65 | 66 | void AMotorStateManager::mix() 67 | { 68 | makeMotorStateBe(); 69 | } 70 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/NeutralMotorState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/NeutralMotorState.h" 5 | 6 | void UNeutralMotorState::activate(UMotorDriveComponent* aMotorDriveComponent) 7 | { 8 | //it's neutral so it doesn't do anything. 9 | } 10 | 11 | FVector UNeutralMotorState::linearAccelerationsGeneratedTo(AJet* aJet) 12 | { 13 | return FVector(0); 14 | } 15 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/MotorStates/ReversingMotorState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/MotorStates/ReversingMotorState.h" 5 | #include "Jet/MotorDriveComponent.h" 6 | #include "Jet/Jet.h" 7 | 8 | void UReversingMotorState::activate(UMotorDriveComponent* aMotorDriveComponent) 9 | { 10 | aMotorDriveComponent->brake(); 11 | } 12 | 13 | FVector UReversingMotorState::linearAccelerationsGeneratedTo(AJet* aJet) 14 | { 15 | return aJet->brakeValue() * (-1) * aJet->ForwardProjectionOnFloor(); 16 | } 17 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/SteerStates/CenterSteerState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/SteerStates/CenterSteerState.h" 5 | 6 | void UCenterSteerState::activate(USteeringComponent* aSteeringComponent) 7 | { 8 | 9 | } 10 | 11 | void UCenterSteerState::changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/SteerStates/LeftSteerState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/SteerStates/LeftSteerState.h" 5 | #include "Jet/Jet.h" 6 | 7 | void ULeftSteerState::activate(USteeringComponent* aSteeringComponent) 8 | { 9 | aSteeringComponent->steerLeft(); 10 | } 11 | 12 | void ULeftSteerState::changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) 13 | { 14 | float aDirection = -1; 15 | aJet->InReverseInverts(aDirection); 16 | UPrimitiveComponent* ownerPrimitiveComponent = Cast(aJet->GetComponentByClass(UPrimitiveComponent::StaticClass())); 17 | 18 | FVector steeringLocation = ownerPrimitiveComponent->GetSocketLocation(FName("FrontSteeringPoint")); 19 | 20 | float centripetalAcceleration = FMath::Pow(aJet->forwardVelocity().Size(), 2) / aJet->steerRadius(); 21 | float effectiveCentripetalAcceleration = FMath::Min(centripetalAcceleration, aSteeringMaximumForce); 22 | FVector steerAcceleration = aJet->rightVectorProjectionOnFloor() * aDirection * effectiveCentripetalAcceleration; 23 | 24 | aLinearAcceleration = steerAcceleration; 25 | FVector primitiveComponentCenterOfMass = ownerPrimitiveComponent->GetCenterOfMass(); 26 | anAngularAcceleration = FVector::CrossProduct(steeringLocation - primitiveComponentCenterOfMass, steerAcceleration); 27 | } 28 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/SteerStates/RightSteerState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/SteerStates/RightSteerState.h" 5 | #include "Jet/Jet.h" 6 | 7 | void URightSteerState::activate(USteeringComponent* aSteeringComponent) 8 | { 9 | aSteeringComponent->steerRight(); 10 | } 11 | 12 | void URightSteerState::changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) 13 | { 14 | float aDirection = 1; 15 | aJet->InReverseInverts(aDirection); 16 | UPrimitiveComponent* ownerPrimitiveComponent = Cast(aJet->GetComponentByClass(UPrimitiveComponent::StaticClass())); 17 | 18 | FVector steeringLocation = ownerPrimitiveComponent->GetSocketLocation(FName("FrontSteeringPoint")); 19 | 20 | float centripetalAcceleration = FMath::Pow(aJet->forwardVelocity().Size(), 2) / aJet->steerRadius(); 21 | float effectiveCentripetalAcceleration = FMath::Min(centripetalAcceleration, aSteeringMaximumForce); 22 | FVector steerAcceleration = aJet->rightVectorProjectionOnFloor() * aDirection * effectiveCentripetalAcceleration; 23 | aLinearAcceleration = steerAcceleration; 24 | FVector primitiveComponentCenterOfMass = ownerPrimitiveComponent->GetCenterOfMass(); 25 | anAngularAcceleration = FVector::CrossProduct(steeringLocation - primitiveComponentCenterOfMass, steerAcceleration); 26 | } 27 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/SteerStates/SteerState.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/SteerStates/SteerState.h" 5 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/Jet/SteerStates/SteerStateManager.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Jet/SteerStates/SteerStateManager.h" 5 | 6 | #include "Jet/SteerStates/CenterSteerState.h" 7 | #include "Jet/SteerStates/RightSteerState.h" 8 | #include "Jet/SteerStates/LeftSteerState.h" 9 | 10 | // Sets default values 11 | ASteerStateManager::ASteerStateManager() 12 | { 13 | PrimaryActorTick.bCanEverTick = false; 14 | steerState = nullptr; 15 | } 16 | 17 | void ASteerStateManager::PostInitializeComponents() 18 | { 19 | Super::PostInitializeComponents(); 20 | updateStateTo(); 21 | owningJet = Cast(GetOwner()); 22 | } 23 | 24 | // Called when the game starts or when spawned 25 | void ASteerStateManager::BeginPlay() 26 | { 27 | Super::BeginPlay(); 28 | } 29 | 30 | void ASteerStateManager::activate(USteeringComponent* aSteeringDrive) 31 | { 32 | steerState->activate(aSteeringDrive); 33 | } 34 | 35 | UClass* ASteerStateManager::stateClass() 36 | { 37 | return steerState->GetClass(); 38 | } 39 | 40 | void ASteerStateManager::overrideStateTo(UClass* anotherState, AJet* anOwningJet) 41 | { 42 | if(owningJet == anOwningJet) 43 | { 44 | steerState = nullptr; 45 | steerState = NewObject(this, anotherState, anotherState->GetFName()); 46 | } 47 | } 48 | 49 | void ASteerStateManager::steerLeft() 50 | { 51 | makeSteerStateBe(); 52 | } 53 | 54 | void ASteerStateManager::center() 55 | { 56 | makeSteerStateBe(); 57 | } 58 | 59 | void ASteerStateManager::steerRight() 60 | { 61 | makeSteerStateBe(); 62 | } 63 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/LapPhases/FinalLapPhase.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "LapPhases/FinalLapPhase.h" 5 | #include "LapPhases/InitialLapPhase.h" 6 | 7 | 8 | bool AFinalLapPhase::nextPhaseIs(ALapPhase* aPhase) 9 | { 10 | return aPhase->comesFromFinalLapPhase(); 11 | } 12 | 13 | bool AFinalLapPhase::comesFromIntermediateLapPhase() 14 | { 15 | return true; 16 | } 17 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/LapPhases/InitialLapPhase.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "LapPhases/InitialLapPhase.h" 5 | #include "LapPhases/IntermediateLapPhase.h" 6 | 7 | 8 | bool AInitialLapPhase::nextPhaseIs(ALapPhase* aPhase) 9 | { 10 | return aPhase->comesFromInitialLapPhase(); 11 | } 12 | 13 | bool AInitialLapPhase::comesFromFinalLapPhase() 14 | { 15 | return true; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/LapPhases/IntermediateLapPhase.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "LapPhases/IntermediateLapPhase.h" 5 | #include "LapPhases/FinalLapPhase.h" 6 | 7 | 8 | bool AIntermediateLapPhase::nextPhaseIs(ALapPhase* aPhase) 9 | { 10 | return aPhase->comesFromIntermediateLapPhase(); 11 | } 12 | 13 | bool AIntermediateLapPhase::comesFromInitialLapPhase() 14 | { 15 | return true; 16 | } 17 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/AnnouncerUI.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/AnnouncerUI.h" 5 | #include "Components/TextBlock.h" 6 | 7 | bool UAnnouncerUI::Initialize() 8 | { 9 | bool initializeResult = Super::Initialize(); 10 | 11 | if(displayText) 12 | { 13 | displayText->SetText(FText::FromString(FString(")-("))); 14 | } 15 | 16 | 17 | return initializeResult; 18 | } 19 | 20 | void UAnnouncerUI::modifyWith(FString aDisplayText) 21 | { 22 | displayText->SetText(FText::FromString(aDisplayText)); 23 | } 24 | 25 | FString UAnnouncerUI::assignedText() 26 | { 27 | return displayText->GetText().ToString(); 28 | } 29 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/MapSelectorWidget.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/MapSelectorWidget.h" 5 | 6 | #include "UI/StringButtonScrollBox.h" 7 | #include "HAL/FileManager.h" 8 | 9 | bool UMapSelectorWidget::Initialize() 10 | { 11 | bool initializeResult = Super::Initialize(); 12 | bIsFocusable = true; 13 | if(mapListing) 14 | { 15 | mapListing->bIsFocusable = true; 16 | createMapButtons(); 17 | } 18 | return initializeResult; 19 | } 20 | 21 | TArray UMapSelectorWidget::mapsCollected() 22 | { 23 | TArray mapPaths = TArray(); 24 | IFileManager::Get().FindFilesRecursive(mapPaths, *FPaths::ProjectContentDir(), TEXT("*.umap"), true, false, false); 25 | 26 | TArray mapNames = TArray(); 27 | 28 | for(FString mapPath : mapPaths) 29 | { 30 | //remove the path 31 | FString mapFile; 32 | FString discard; 33 | mapPath.Split(mapsDirectory, &discard, &mapFile); 34 | 35 | //remove the extension 36 | FString mapName; 37 | if(mapFile.Split(".", &mapName, &discard)) 38 | { 39 | //add map name to the list 40 | mapNames.Add(mapName); 41 | } 42 | } 43 | return mapNames; 44 | } 45 | 46 | FString UMapSelectorWidget::selectedMap() 47 | { 48 | return mapListing->selectedString(); 49 | } 50 | 51 | void UMapSelectorWidget::subscribeToMapUpdate(ALobbyGameState* aGameState) 52 | { 53 | mapListing->subscribeToSelectedStringUpdate(aGameState); 54 | } 55 | 56 | void UMapSelectorWidget::subscribeToMapUpdate(ULobbyMenu* ALobbyMenu) 57 | { 58 | mapListing->subscribeToSelectedStringUpdate(ALobbyMenu); 59 | } 60 | 61 | void UMapSelectorWidget::createMapButtons() 62 | { 63 | TArray mapsFound = mapsCollected(); 64 | mapListing->populateBoxWith(mapsFound); 65 | } 66 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/Menu.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/Menu.h" 5 | #include "Components/Button.h" 6 | 7 | FVector2D UMenu::buttonAbsoluteCenterPosition(UButton *aButton) 8 | { 9 | FVector2D buttonCenter = FVector2D(0.5f, 0.5f); 10 | return aButton->GetTickSpaceGeometry().GetAbsolutePositionAtCoordinates(buttonCenter); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/PauseMenu.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/PauseMenu.h" 5 | #include "Kismet/GameplayStatics.h" 6 | #include "Components/Button.h" 7 | 8 | void UPauseMenu::returnToMainMenu() 9 | { 10 | GetGameInstance()->ReturnToMainMenu(); 11 | } 12 | 13 | void UPauseMenu::removeFromViewportAndResumeGame() 14 | { 15 | RemoveFromViewport(); 16 | focusOnGame(); 17 | } 18 | 19 | void UPauseMenu::focusOnGame() 20 | { 21 | UGameplayStatics::SetGamePaused(GetWorld(), false); 22 | FInputModeGameOnly inputModeData; 23 | inputModeData.SetConsumeCaptureMouseDown(true); 24 | APlayerController* controller = GetWorld()->GetFirstPlayerController(); 25 | controller->SetInputMode(inputModeData); 26 | controller->bShowMouseCursor = false; 27 | } 28 | 29 | FVector2D UPauseMenu::returnButtonAbsoluteCenterPosition() 30 | { 31 | return buttonAbsoluteCenterPosition(returnButton); 32 | } 33 | 34 | FVector2D UPauseMenu::resumeButtonAbsoluteCenterPosition() 35 | { 36 | return buttonAbsoluteCenterPosition(resumeButton); 37 | } 38 | 39 | bool UPauseMenu::Initialize() 40 | { 41 | bool initializeResult = Super::Initialize(); 42 | 43 | if(returnButton) 44 | { 45 | returnButton->OnClicked.AddDynamic(this, &UPauseMenu::returnToMainMenu); 46 | returnButton->OnPressed.AddDynamic(this, &UPauseMenu::returnToMainMenu); 47 | bIsFocusable = true; 48 | } 49 | if(resumeButton) 50 | { 51 | resumeButton->OnClicked.AddDynamic(this, &UPauseMenu::removeFromViewportAndResumeGame); 52 | resumeButton->OnPressed.AddDynamic(this, &UPauseMenu::removeFromViewportAndResumeGame); 53 | bIsFocusable = true; 54 | } 55 | bIsFocusable = true; 56 | 57 | return initializeResult; 58 | } 59 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/PlayerPositionRow.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/PlayerPositionRow.h" 5 | #include "Components/TextBlock.h" 6 | 7 | void UPlayerPositionRow::updateInfoWith(FString aPlayerName, FString aPosition) 8 | { 9 | playerNameText->SetText(FText::FromString(aPlayerName)); 10 | positionText->SetText(FText::FromString(aPosition)); 11 | } 12 | 13 | FString UPlayerPositionRow::playerName() 14 | { 15 | return playerNameText->GetText().ToString(); 16 | } 17 | 18 | FString UPlayerPositionRow::position() 19 | { 20 | return positionText->GetText().ToString(); 21 | } 22 | -------------------------------------------------------------------------------- /Source/ProjectR/Private/UI/StringHolderButton.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "UI/StringHolderButton.h" 5 | #include "UI/StringButtonScrollBox.h" 6 | 7 | bool UStringHolderButton::Initialize() 8 | { 9 | bool initializeResult = Super::Initialize(); 10 | bIsFocusable = true; 11 | if(textButton) 12 | { 13 | textButton->OnClicked.AddDynamic(this, &UStringHolderButton::buttonClickedEvent); 14 | textButton->OnPressed.AddDynamic(this, &UStringHolderButton::buttonClickedEvent); 15 | textButton->IsFocusable = true; 16 | textButton->SetClickMethod(EButtonClickMethod::MouseDown); 17 | } 18 | 19 | return initializeResult; 20 | } 21 | 22 | void UStringHolderButton::store(FString aString) 23 | { 24 | if(textHolder) 25 | { 26 | textHolder->SetText(FText::FromString(aString)); 27 | } 28 | } 29 | 30 | FString UStringHolderButton::storedString() 31 | { 32 | return textHolder->GetText().ToString(); 33 | } 34 | 35 | FVector2D UStringHolderButton::buttonCoordinates() 36 | { 37 | FVector2D buttonCenter = FVector2D(0.5f, 0.5f); 38 | return textButton->GetTickSpaceGeometry().GetAbsolutePositionAtCoordinates(buttonCenter); 39 | } 40 | 41 | void UStringHolderButton::buttonClickedEvent() 42 | { 43 | UStringButtonScrollBox* expectedParent = Cast(GetTypedOuter(UStringButtonScrollBox::StaticClass())); 44 | if(expectedParent) 45 | { 46 | expectedParent->childClicked(this); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Source/ProjectR/ProjectR.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class ProjectR : ModuleRules 6 | { 7 | public ProjectR(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange(new string[] { 12 | "Core", 13 | "CoreUObject", 14 | "Engine", 15 | "InputCore", 16 | "UMG", 17 | "OnlineSubsystem", 18 | "OnlineSubsystemUtils", 19 | "PhysX" 20 | }); 21 | 22 | PrivateDependencyModuleNames.AddRange(new string[] { }); 23 | 24 | DynamicallyLoadedModuleNames.Add("OnlineSubsystemNull"); 25 | 26 | // Uncomment if you are using Slate UI 27 | PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 28 | 29 | // Uncomment if you are using online features 30 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 31 | 32 | // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/ProjectR/ProjectR.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "ProjectR.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, ProjectR, "ProjectR" ); 7 | -------------------------------------------------------------------------------- /Source/ProjectR/ProjectR.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Engine.h" 6 | #include "Net/UnrealNetwork.h" 7 | #include "Online.h" 8 | 9 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameMode/RaceStages/RaceBeginningStage.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceStage.h" 7 | #include "RaceBeginningStage.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API ARaceBeginningStage : public ARaceStage 14 | { 15 | GENERATED_BODY() 16 | 17 | protected: 18 | FTimerHandle countdownTimer; 19 | void loadAnnouncerOnControllers(); 20 | 21 | public: 22 | virtual void start() override; 23 | 24 | UFUNCTION() 25 | void countdownToStart(int countdown=3); 26 | 27 | virtual ARaceStage* nextStage() override; 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameMode/RaceStages/RaceEndedStage.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceStage.h" 7 | #include "RaceEndedStage.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API ARaceEndedStage : public ARaceStage 14 | { 15 | GENERATED_BODY() 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameMode/RaceStages/RacePreparationStage.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceStage.h" 7 | #include "RacePreparationStage.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API ARacePreparationStage : public ARaceStage 14 | { 15 | GENERATED_BODY() 16 | 17 | protected: 18 | virtual void BeginPlay() override; 19 | public: 20 | 21 | ARaceStage* nextStage() override; 22 | 23 | void start() override; 24 | }; 25 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameMode/RaceStages/RaceRunningStage.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceStage.h" 7 | #include "RaceRunningStage.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API ARaceRunningStage : public ARaceStage 14 | { 15 | GENERATED_BODY() 16 | 17 | protected: 18 | FTimerHandle announcerRemovalDelay; 19 | 20 | UFUNCTION() 21 | void removeAnnouncersFromControllers(); 22 | 23 | public: 24 | ARaceStage* nextStage() override; 25 | void Tick(float DeltaSeconds) override; 26 | 27 | void start() override; 28 | }; 29 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameMode/RaceStages/RaceStage.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include "RaceStage.generated.h" 8 | 9 | class ARaceGameMode; 10 | 11 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FStageEndedEvent, ARaceStage*, broadcasterStage); 12 | 13 | 14 | UCLASS() 15 | class PROJECTR_API ARaceStage : public AActor 16 | { 17 | GENERATED_BODY() 18 | 19 | 20 | public: 21 | // Sets default values for this actor's properties 22 | ARaceStage(); 23 | 24 | protected: 25 | // Called when the game starts or when spawned 26 | virtual void BeginPlay() override; 27 | ARaceGameMode* raceMode; 28 | 29 | public: 30 | // Called every frame 31 | virtual void Tick(float DeltaTime) override; 32 | 33 | virtual ARaceStage* nextStage(); 34 | 35 | UPROPERTY(BlueprintAssignable, Category = "Events") 36 | FStageEndedEvent stageEndedEvent; 37 | 38 | virtual void start(); 39 | }; 40 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameState/LobbyGameState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/GameStateBase.h" 7 | #include "LobbyGameState.generated.h" 8 | 9 | class ULobbyMenu; 10 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLobbyMapUpdateEvent, FString, anUpdatedMap); 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API ALobbyGameState : public AGameStateBase 16 | { 17 | GENERATED_BODY() 18 | 19 | 20 | protected: 21 | 22 | UPROPERTY(ReplicatedUsing= fireLobbyMapUpdateEvent) 23 | FString selectedMap; 24 | 25 | UPROPERTY(BlueprintAssignable, Category = "Events") 26 | FLobbyMapUpdateEvent mapUpdateEvent; 27 | 28 | UFUNCTION() 29 | void fireLobbyMapUpdateEvent(); 30 | 31 | 32 | public: 33 | UFUNCTION() 34 | void updateSelectedMap(FString anUpdatedMap); 35 | 36 | void subscribeToLobbyMapUpdate(ULobbyMenu* aLobbyMenu); 37 | 38 | FString selectedMapName(); 39 | }; 40 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/GameState/ProjectRGameState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/GameStateBase.h" 7 | #include "ProjectRGameState.generated.h" 8 | 9 | class URaceResultsUI; 10 | class UAnnouncerUI; 11 | class UPauseMenu; 12 | 13 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAnnouncerUpdateEvent, FString, anUpdatedText); 14 | /** 15 | * 16 | */ 17 | UCLASS() 18 | class PROJECTR_API AProjectRGameState : public AGameStateBase 19 | { 20 | GENERATED_BODY() 21 | 22 | protected: 23 | 24 | UPROPERTY(ReplicatedUsing= fireAnnouncerUpdateEvent) 25 | FString announcerText; 26 | 27 | UPROPERTY(BlueprintAssignable, Category = "Events") 28 | FAnnouncerUpdateEvent announcerUpdateEvent; 29 | 30 | UFUNCTION() 31 | void fireAnnouncerUpdateEvent(); 32 | 33 | UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Settings") 34 | TSubclassOf announcerUIClass; 35 | 36 | UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Settings") 37 | TSubclassOf resultsUIClass; 38 | 39 | //public: 40 | // UPROPERTY(EditDefaultsOnly, Category= "Menus") 41 | // TSubclassOf pauseMenuClass; 42 | 43 | public: 44 | void subscribeToAnnouncerUpdate(UAnnouncerUI* anAnnouncerUI); 45 | void updateAnnouncerWith(FString aText); 46 | FString announcerDisplayText(); 47 | UClass* announcerUIType(); 48 | void fireEvents(); 49 | UClass* resultsUIType(); 50 | }; 51 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/AntiGravityComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Components/ActorComponent.h" 7 | #include "AntiGravityComponent.generated.h" 8 | 9 | 10 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 11 | class PROJECTR_API UAntiGravityComponent : public UActorComponent 12 | { 13 | GENERATED_BODY() 14 | 15 | private: 16 | AActor* owner; 17 | UPrimitiveComponent* ownerPrimitiveComponent; 18 | public: 19 | UAntiGravityComponent(); 20 | 21 | protected: 22 | virtual void BeginPlay() override; 23 | 24 | UPROPERTY(EditAnywhere, Category = "Anti-Gravity Settings") 25 | float levitationHeight; 26 | UPROPERTY(EditAnywhere, Category = "Anti-Gravity Settings") 27 | float antiGravityForceValue; 28 | 29 | void activateAvoidanceTo(FHitResult anObstacle, FVector aVertexLocation); 30 | 31 | public: 32 | void antiGravityLifting(); 33 | // Called every frame 34 | virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; 35 | 36 | float triggerHeight(); 37 | 38 | void currentChangesMadeTo(FVector& aLinearAcceleration, FVector& anAngularAcceleration); 39 | }; 40 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorDriveComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Components/ActorComponent.h" 7 | #include "MotorDriveComponent.generated.h" 8 | 9 | class AJet; 10 | 11 | UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent)) 12 | class PROJECTR_API UMotorDriveComponent : public UActorComponent 13 | { 14 | GENERATED_BODY() 15 | 16 | private: 17 | AJet* jet; 18 | UPrimitiveComponent* jetPhysicsComponent; 19 | public: 20 | // Sets default values for this component's properties 21 | UMotorDriveComponent(); 22 | 23 | protected: 24 | // Called when the game starts 25 | virtual void BeginPlay() override; 26 | 27 | UPROPERTY(EditAnywhere, Category = "Motor Settings") 28 | float accelerationValue; 29 | 30 | UPROPERTY(EditAnywhere, Category = "Motor Settings") 31 | float brakeAbsoluteValue; 32 | 33 | UPROPERTY(EditAnywhere, Category = "Motor Settings") 34 | float topSpeed; 35 | 36 | public: 37 | float currentSpeed(); 38 | 39 | float settedTopSpeed(); 40 | 41 | void accelerate(float anAccelerationMultiplier = 1.0f); 42 | 43 | float acceleration(); 44 | 45 | float brakeValue(); 46 | 47 | void brake(float aBrakeMultiplier = 1.0f); 48 | 49 | bool goesForward(); 50 | 51 | bool goesBackwards(); 52 | }; 53 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorStates/AcceleratingMotorState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/MotorStates/MotorState.h" 7 | #include "AcceleratingMotorState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UAcceleratingMotorState : public UMotorState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(UMotorDriveComponent* aMotorDriveComponent) override; 19 | virtual FVector linearAccelerationsGeneratedTo(AJet* aJet); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorStates/MixedMotorState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/MotorStates/MotorState.h" 7 | #include "MixedMotorState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UMixedMotorState : public UMotorState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(UMotorDriveComponent* aMotorDriveComponent) override; 19 | virtual FVector linearAccelerationsGeneratedTo(AJet* aJet); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorStates/MotorState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "Core.h" 6 | #include "MotorState.generated.h" 7 | 8 | class AJet; 9 | class UMotorDriveComponent; 10 | 11 | UCLASS(Abstract) 12 | class PROJECTR_API UMotorState : public UObject 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | // Sets default values for this actor's properties 18 | UMotorState(); 19 | virtual void activate(UMotorDriveComponent* aMotorDriveComponent) PURE_VIRTUAL(UMotorState::activate, return; );//I don't like this. It should be =0 instead of a macro... 20 | virtual FVector linearAccelerationsGeneratedTo(AJet* aJet) PURE_VIRTUAL(UMotorState::linearAccelerationsGeneratedTo, return FVector(0); );//I don't like this. It should be =0 instead of a macro... 21 | }; 22 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorStates/NeutralMotorState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/MotorStates/MotorState.h" 7 | #include "NeutralMotorState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UNeutralMotorState : public UMotorState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(UMotorDriveComponent* aMotorDriveComponent) override; 19 | virtual FVector linearAccelerationsGeneratedTo(AJet* aJet); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/MotorStates/ReversingMotorState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/MotorStates/MotorState.h" 7 | #include "ReversingMotorState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UReversingMotorState : public UMotorState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(UMotorDriveComponent* aMotorDriveComponent) override; 19 | virtual FVector linearAccelerationsGeneratedTo(AJet* aJet); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/SteerStates/CenterSteerState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/SteerStates/SteerState.h" 7 | #include "CenterSteerState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UCenterSteerState : public USteerState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(USteeringComponent* aSteeringComponent) override; 19 | virtual void changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) override; 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/SteerStates/LeftSteerState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/SteerStates/SteerState.h" 7 | #include "LeftSteerState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API ULeftSteerState : public USteerState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(USteeringComponent* aSteeringComponent) override; 19 | virtual void changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) override; 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/SteerStates/RightSteerState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/SteerStates/SteerState.h" 7 | #include "RightSteerState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API URightSteerState : public USteerState 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(USteeringComponent* aSteeringComponent) override; 19 | virtual void changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) override; 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/SteerStates/SteerState.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "Core.h" 6 | #include "Jet/SteeringComponent.h" 7 | #include "SteerState.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS(Abstract) 13 | class PROJECTR_API USteerState : public UObject 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | virtual void activate(USteeringComponent* aSteeringComponent) PURE_VIRTUAL(USteerState::activate, ; );//I don't like this. It should be =0 instead of a macro... 19 | virtual void changesMadeTo(AJet* aJet, FVector& aLinearAcceleration, FVector& anAngularAcceleration, float aSteeringMaximumForce) PURE_VIRTUAL(USteerState::changesMadeTo, ; );//I don't like this. It should be =0 instead of a macro... 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Jet/SteeringComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Components/ActorComponent.h" 7 | #include "SteeringComponent.generated.h" 8 | 9 | class AJet; 10 | 11 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 12 | class PROJECTR_API USteeringComponent : public UActorComponent 13 | { 14 | GENERATED_BODY() 15 | 16 | private: 17 | AJet* owner; 18 | UPrimitiveComponent* ownerPrimitiveComponent; 19 | 20 | public: 21 | USteeringComponent(); 22 | 23 | protected: 24 | virtual void BeginPlay() override; 25 | 26 | UFUNCTION() 27 | void alignVelocityFrom(FVector aPreviousForwardVector, FVector aPreviousLocation); 28 | void InReverseInverts(float& aDirectionMultiplier); 29 | 30 | UPROPERTY(EditAnywhere, Category = "Steering Settings") 31 | float steerRadius; 32 | 33 | UPROPERTY(EditAnywhere, Category = "Steering Settings") 34 | float steerMaximumForce; 35 | 36 | void steer(float aDirectionMultiplier); 37 | public: 38 | 39 | float steeringRadius(); 40 | 41 | void steerLeft(); 42 | void steerRight(); 43 | 44 | float accelerationMagnitudeToAlignVelocityFrom(FVector aPreviousLocation); 45 | float maximumAllowedSteeringForce(); 46 | }; 47 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/LapManager/LapManager.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | 8 | #include "GameFramework/Actor.h" 9 | #include "LapManager.generated.h" 10 | 11 | 12 | class ARaceGameMode; 13 | class AJet; 14 | class ALapPhase; 15 | class AFinalLapPhase; 16 | 17 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLapCompletedEvent, AJet*, aCrossingJet); 18 | 19 | USTRUCT() 20 | struct FLapData 21 | { 22 | GENERATED_BODY() 23 | 24 | int lap = 0; 25 | ALapPhase* currentLapPhase; 26 | ALapPhase* lastCrossedPhase; 27 | }; 28 | 29 | UCLASS() 30 | class PROJECTR_API ALapManager : public AActor 31 | { 32 | GENERATED_BODY() 33 | 34 | private: 35 | AFinalLapPhase* finalPhase; 36 | 37 | public: 38 | // Sets default values for this actor's properties 39 | ALapManager(); 40 | 41 | protected: 42 | // Called when the game starts or when spawned 43 | virtual void BeginPlay() override; 44 | TMap jetLaps; 45 | void configureJetLaps(); 46 | void subscribeToLapPhases(); 47 | void checkPhaseAndSubscribe(ALapPhase* aPhase); 48 | 49 | UPROPERTY(BlueprintAssignable, Category = "Events") 50 | FLapCompletedEvent lapCompletedEvent; 51 | 52 | void establishLapPhasesDistances(); 53 | 54 | public: 55 | 56 | TMap jetsInPlay(); 57 | 58 | UFUNCTION() 59 | void lapPhaseOverlap(AActor* OverlappedActor, AActor* OtherActor); 60 | 61 | int currentLapOf(AJet* aJet); 62 | 63 | void subscribeToLapCross(ARaceGameMode* aRaceMode); 64 | 65 | float maximumAllowedDistanceOf(AJet* aJet); 66 | }; 67 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/LapPhases/FinalLapPhase.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "LapPhases/LapPhase.h" 7 | #include "FinalLapPhase.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API AFinalLapPhase : public ALapPhase 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | 19 | bool nextPhaseIs(ALapPhase* aPhase) override; 20 | 21 | bool comesFromIntermediateLapPhase() override; 22 | }; 23 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/LapPhases/InitialLapPhase.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "LapPhases/LapPhase.h" 7 | #include "InitialLapPhase.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API AInitialLapPhase : public ALapPhase 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | 19 | bool nextPhaseIs(ALapPhase* aPhase) override; 20 | 21 | bool comesFromFinalLapPhase() override; 22 | }; 23 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/LapPhases/IntermediateLapPhase.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "LapPhases/LapPhase.h" 7 | #include "IntermediateLapPhase.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API AIntermediateLapPhase : public ALapPhase 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | 19 | bool nextPhaseIs(ALapPhase* aPhase) override; 20 | 21 | bool comesFromInitialLapPhase() override; 22 | }; 23 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/LapPhases/LapPhase.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include "LapPhase.generated.h" 8 | 9 | 10 | UCLASS() 11 | class PROJECTR_API ALapPhase : public AActor 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | // Sets default values for this actor's properties 17 | ALapPhase(); 18 | 19 | protected: 20 | // Called when the game starts or when spawned 21 | virtual void BeginPlay() override; 22 | 23 | UStaticMeshComponent* phaseWall; 24 | 25 | UPROPERTY(EditAnywhere, Category = "Phase Wall Mesh") 26 | UStaticMesh* phaseWallMesh; 27 | 28 | float allowedDistance; 29 | 30 | public: 31 | 32 | ALapPhase* updatePhase(ALapPhase* anotherPhase); 33 | 34 | virtual bool nextPhaseIs(ALapPhase* aPhase); 35 | 36 | virtual bool comesFromInitialLapPhase(); 37 | virtual bool comesFromIntermediateLapPhase(); 38 | virtual bool comesFromFinalLapPhase(); 39 | 40 | float maximumAllowedDistance(); 41 | void establishDistanceTo(float aNewDistance); 42 | }; 43 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/PlayerController/ProjectRPlayerController.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/PlayerController.h" 7 | #include "ProjectRPlayerController.generated.h" 8 | 9 | class URaceResultsUI; 10 | class AProjectRGameState; 11 | class UAnnouncerUI; 12 | class URacePlayerUI; 13 | class UPauseMenu; 14 | /** 15 | * 16 | */ 17 | UCLASS() 18 | class PROJECTR_API AProjectRPlayerController : public APlayerController 19 | { 20 | GENERATED_BODY() 21 | 22 | protected: 23 | UPROPERTY() 24 | UPauseMenu* pauseMenu; 25 | 26 | virtual void SetupInputComponent() override; 27 | 28 | 29 | UPROPERTY() 30 | URacePlayerUI* raceUI; 31 | 32 | UPROPERTY() 33 | UAnnouncerUI* announcerUI; 34 | 35 | UPROPERTY() 36 | URaceResultsUI* raceResultsUI; 37 | 38 | UPROPERTY(EditDefaultsOnly, Category= "Menus") 39 | TSubclassOf pauseMenuClass; 40 | 41 | void showRaceUI(); 42 | 43 | UFUNCTION() 44 | void configureRaceUI(); 45 | 46 | void configureAnnouncerUI(AProjectRGameState* aGameState); 47 | void showAnnouncerUI(); 48 | void showResultsUI(); 49 | 50 | 51 | public: 52 | AProjectRPlayerController(const FObjectInitializer& ObjectInitializer); 53 | void focusOnGame(); 54 | void focusOnPauseMenu(); 55 | 56 | UFUNCTION(Client, Reliable) 57 | void loadRaceUI(); 58 | 59 | 60 | 61 | UPauseMenu* loadPauseMenu(); 62 | 63 | UFUNCTION() 64 | void loadPauseMenuWrapper(); 65 | 66 | UFUNCTION(Client, Reliable) 67 | void loadAnnouncerUI(); 68 | 69 | UFUNCTION(Client, Reliable) 70 | void removeAnnouncerUI(); 71 | 72 | UFUNCTION(Client, Reliable) 73 | void loadResultsUI(); 74 | 75 | UFUNCTION(Client, Reliable) 76 | void changeInputModeToGame(); 77 | }; 78 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/Track/TrackManager.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include "TrackManager.generated.h" 8 | 9 | class ATrackGenerator; 10 | class AJet; 11 | 12 | UCLASS() 13 | class PROJECTR_API ATrackManager : public AActor 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | // Sets default values for this actor's properties 19 | ATrackManager(); 20 | 21 | 22 | 23 | protected: 24 | // Called when the game starts or when spawned 25 | virtual void BeginPlay() override; 26 | 27 | TSet trackGeneratorSet; 28 | void collectTrackGenerators(); 29 | void subscribeToTrackGeneratorsMagnetSplines(); 30 | TMap jetsToMagnetize; 31 | 32 | void manageMagnetization(); 33 | void prepareMagnetizationOf(AJet* aJet, FVector aTrackUpVector); 34 | void magnetize(UStaticMeshComponent* aJetRootComponent, FVector aJetWeightAbsolute, FVector aRoadNormal); 35 | void CounterGravityForce(UStaticMeshComponent* aJetRootComponent, FVector aJetWeightAbsolute); 36 | void pullTowardsFloor(UStaticMeshComponent* aJetRootComponent, FVector aJetWeightAbsolute, FVector aRoadNormal); 37 | public: 38 | // Called every frame 39 | virtual void Tick(float DeltaTime) override; 40 | 41 | UFUNCTION() 42 | void addJetToMagnetize (UPrimitiveComponent* OverlappedComponent, 43 | AActor* OtherActor, 44 | UPrimitiveComponent* OtherComp, 45 | int32 OtherBodyIndex, 46 | bool bFromSweep, 47 | const FHitResult& SweepResult); 48 | 49 | bool hasJetsStored(); 50 | 51 | void addGeneratorAndSubscribe(ATrackGenerator* newGenerator); 52 | 53 | FVector pullingAccelerationTo(AJet* aJet); 54 | }; 55 | 56 | 57 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/AnnouncerUI.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Blueprint/UserWidget.h" 7 | #include "AnnouncerUI.generated.h" 8 | 9 | class UTextBlock; 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class PROJECTR_API UAnnouncerUI : public UUserWidget 15 | { 16 | GENERATED_BODY() 17 | 18 | protected: 19 | 20 | UPROPERTY(meta = (BindWidget)) 21 | UTextBlock* displayText; 22 | 23 | public: 24 | virtual bool Initialize() override; 25 | 26 | UFUNCTION() 27 | void modifyWith(FString aDisplayText); 28 | 29 | FString assignedText(); 30 | }; 31 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/LanMultiplayerMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "LanMultiplayerMenu.generated.h" 8 | 9 | class UProjectRGameInstance; 10 | class UStringButtonScrollBox; 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API ULanMultiplayerMenu : public UMenu 16 | { 17 | GENERATED_BODY() 18 | 19 | UProjectRGameInstance* gameInstance; 20 | public: 21 | virtual bool Initialize() override; 22 | FVector2D goBackButtonAbsoluteCenterPosition(); 23 | FVector2D createSessionButtonAbsoluteCenterPosition(); 24 | void sessionSearchCompletedAnd(bool aSessionSearchWasSuccessful); 25 | 26 | protected: 27 | UPROPERTY(meta = (BindWidget)) 28 | UButton* goBackButton; 29 | 30 | UPROPERTY(meta = (BindWidget)) 31 | UButton* createSessionButton; 32 | 33 | UPROPERTY(meta = (BindWidget)) 34 | UStringButtonScrollBox* sessionListingBox; 35 | 36 | UPROPERTY(meta = (BindWidget)) 37 | UButton* joinSessionButton; 38 | 39 | UFUNCTION() 40 | void goBack(); 41 | 42 | UFUNCTION() 43 | void startLANSessionCreation(); 44 | 45 | UFUNCTION() 46 | void joinSelectedSession(); 47 | 48 | FTimerHandle retrySessionSearchTimer; 49 | 50 | UPROPERTY(EditDefaultsOnly, Category = "Session Search Timer") 51 | float timeBetweenSearches; 52 | }; 53 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/LobbyMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "LobbyMenu.generated.h" 8 | 9 | class UTextBlock; 10 | class UMapSelectorWidget; 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API ULobbyMenu : public UMenu 16 | { 17 | GENERATED_BODY() 18 | 19 | 20 | 21 | 22 | protected: 23 | UFUNCTION() 24 | void returnToMainMenu(); 25 | 26 | UFUNCTION() 27 | void startRace(); 28 | 29 | UPROPERTY(meta = (BindWidget)) 30 | UButton* returnButton; 31 | 32 | UPROPERTY(meta = (BindWidget)) 33 | UMapSelectorWidget* mapListing; 34 | 35 | UPROPERTY(meta = (BindWidget)) 36 | UButton* startRaceButton; 37 | 38 | UPROPERTY(meta = (BindWidget)) 39 | UTextBlock* playersInLobbyText; 40 | 41 | UPROPERTY(meta = (BindWidget)) 42 | UTextBlock* selectedMapText; 43 | 44 | void focusPlayersOnGame(); 45 | void updatePlayersInLobby(); 46 | bool localOwnerHasAuthority(); 47 | 48 | UFUNCTION() 49 | void subscribeGameStateToMapUpdateEvent(); 50 | 51 | 52 | public: 53 | virtual bool Initialize() override; 54 | virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override; 55 | FVector2D returnButtonAbsoluteCenterPosition(); 56 | FVector2D startRaceButtonAbsoluteCenterPosition(); 57 | UFUNCTION() 58 | void updateSelectedMapText(FString aText); 59 | 60 | int connectedPlayers(); 61 | FString selectedMap(); 62 | 63 | }; 64 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/LocalMultiplayerMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "LocalMultiplayerMenu.generated.h" 8 | 9 | class UMapSelectorWidget; 10 | class UComboBoxString; 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API ULocalMultiplayerMenu : public UMenu 16 | { 17 | GENERATED_BODY() 18 | 19 | protected: 20 | void focusOnGame(); 21 | 22 | UFUNCTION() 23 | void goBack(); 24 | 25 | UFUNCTION() 26 | void play(); 27 | 28 | UPROPERTY(meta = (BindWidget)) 29 | UButton* goBackButton; 30 | 31 | UPROPERTY(meta = (BindWidget)) 32 | UButton* playButton; 33 | 34 | UPROPERTY(meta = (BindWidget)) 35 | UComboBoxString* playersQuantitySelection; 36 | 37 | UPROPERTY(meta = (BindWidget)) 38 | UMapSelectorWidget* mapListing; 39 | 40 | public: 41 | virtual bool Initialize() override; 42 | 43 | FVector2D goBackButtonAbsoluteCenterPosition(); 44 | 45 | FVector2D playButtonAbsoluteCenterPosition(); 46 | 47 | int selectedPlayerQuantity(); 48 | }; 49 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/MainMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "MainMenu.generated.h" 8 | 9 | class UButton; 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class PROJECTR_API UMainMenu : public UMenu 15 | { 16 | GENERATED_BODY() 17 | 18 | protected: 19 | UFUNCTION() 20 | void quit(); 21 | 22 | UFUNCTION() 23 | void bringSingleplayerMenu(); 24 | 25 | UFUNCTION() 26 | void bringLocalMultiplayerMenu(); 27 | 28 | UFUNCTION() 29 | void bringLanMultiplayerMenu(); 30 | 31 | UPROPERTY(meta = (BindWidget)) 32 | UButton* quitButton; 33 | 34 | UPROPERTY(meta = (BindWidget)) 35 | UButton* singleplayerButton; 36 | 37 | UPROPERTY(meta = (BindWidget)) 38 | UButton* localMultiplayerButton; 39 | 40 | UPROPERTY(meta = (BindWidget)) 41 | UButton* lanMultiplayerButton; 42 | 43 | public: 44 | virtual bool Initialize() override; 45 | 46 | FVector2D quitButtonAbsoluteCenterPosition(); 47 | 48 | FVector2D singleplayerButtonAbsoluteCenterPosition(); 49 | 50 | FVector2D localMultiplayerButtonAbsoluteCenterPosition(); 51 | 52 | FVector2D lanMultiplayerButtonAbsoluteCenterPosition(); 53 | }; 54 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/MapSelectorWidget.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "StringButtonScrollBox.h" 8 | #include "Blueprint/UserWidget.h" 9 | #include "MapSelectorWidget.generated.h" 10 | 11 | class ULobbyMenu; 12 | class ALobbyGameState; 13 | class UStringButtonScrollBox; 14 | /** 15 | * 16 | */ 17 | UCLASS() 18 | class PROJECTR_API UMapSelectorWidget : public UUserWidget 19 | { 20 | GENERATED_BODY() 21 | 22 | public: 23 | virtual bool Initialize() override; 24 | TArray mapsCollected(); 25 | FString selectedMap(); 26 | 27 | void subscribeToMapUpdate(ALobbyGameState* aGameState); 28 | void subscribeToMapUpdate(ULobbyMenu* ALobbyMenu); 29 | 30 | protected: 31 | 32 | UPROPERTY(meta = (BindWidget)) 33 | UStringButtonScrollBox* mapListing; 34 | 35 | /// 36 | /// Remember that the folders start with /... 37 | /// 38 | UPROPERTY(EditDefaultsOnly) 39 | FString mapsDirectory; 40 | 41 | void createMapButtons(); 42 | }; 43 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/Menu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Blueprint/UserWidget.h" 7 | #include "Menu.generated.h" 8 | 9 | class UButton; 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class PROJECTR_API UMenu : public UUserWidget 15 | { 16 | GENERATED_BODY() 17 | 18 | protected: 19 | FVector2D buttonAbsoluteCenterPosition(UButton* aButton); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/PauseMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "PauseMenu.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class PROJECTR_API UPauseMenu : public UMenu 14 | { 15 | GENERATED_BODY() 16 | 17 | protected: 18 | 19 | UPROPERTY(meta = (BindWidget)) 20 | UButton* returnButton; 21 | 22 | UFUNCTION() 23 | void returnToMainMenu(); 24 | 25 | UPROPERTY(EditAnywhere, Category="Menu Map") 26 | FName mainMenuLevel; 27 | 28 | UPROPERTY(meta = (BindWidget)) 29 | UButton* resumeButton; 30 | 31 | UFUNCTION() 32 | void removeFromViewportAndResumeGame(); 33 | 34 | void focusOnGame(); 35 | 36 | public: 37 | FVector2D returnButtonAbsoluteCenterPosition(); 38 | 39 | FVector2D resumeButtonAbsoluteCenterPosition(); 40 | 41 | virtual bool Initialize() override; 42 | }; 43 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/PlayerPositionRow.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Blueprint/UserWidget.h" 7 | #include "PlayerPositionRow.generated.h" 8 | 9 | class UTextBlock; 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class PROJECTR_API UPlayerPositionRow : public UUserWidget 15 | { 16 | GENERATED_BODY() 17 | 18 | protected: 19 | 20 | UPROPERTY(meta = (BindWidget)) 21 | UTextBlock* playerNameText; 22 | 23 | UPROPERTY(meta = (BindWidget)) 24 | UTextBlock* positionText; 25 | 26 | 27 | public: 28 | 29 | void updateInfoWith(FString aPlayerName, FString aPosition); 30 | FString playerName(); 31 | FString position(); 32 | 33 | }; 34 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/RacePlayerUI.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "Blueprint/UserWidget.h" 8 | #include "RacePlayerUI.generated.h" 9 | 10 | class UTextBlock; 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API URacePlayerUI : public UUserWidget 16 | { 17 | GENERATED_BODY() 18 | 19 | protected: 20 | 21 | UPROPERTY(meta = (BindWidget)) 22 | UTextBlock* currentLapText; 23 | 24 | UPROPERTY(meta = (BindWidget)) 25 | UTextBlock* totalLapsText; 26 | 27 | UPROPERTY(meta = (BindWidget)) 28 | UTextBlock* currentPositionText; 29 | 30 | void changeIntegerTextOf(UTextBlock* aTextBlock, int aNewValue); 31 | 32 | public: 33 | virtual bool Initialize() override; 34 | 35 | UFUNCTION() 36 | void updateLapTo(int aNewLap); 37 | 38 | UFUNCTION() 39 | void updatePositionTo(int aNewPosition); 40 | 41 | UFUNCTION() 42 | void modifyTotalLapsTo(int aNewTotalLapsValue); 43 | 44 | void setTotalLapsTo(int aDesiredValue); 45 | 46 | int currentLap(); 47 | int totalLaps(); 48 | int currentPosition(); 49 | }; 50 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/RaceResultsUI.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "PlayerState/RacePlayerState.h" 8 | #include "Blueprint/UserWidget.h" 9 | #include "RaceResultsUI.generated.h" 10 | 11 | class UPlayerPositionRow; 12 | class UVerticalBox; 13 | /** 14 | * 15 | */ 16 | UCLASS() 17 | class PROJECTR_API URaceResultsUI : public UUserWidget 18 | { 19 | GENERATED_BODY() 20 | 21 | protected: 22 | 23 | UPROPERTY(meta = (BindWidget)) 24 | UVerticalBox* infoBox; 25 | 26 | UPROPERTY(EditDefaultsOnly, Category = "Settings") 27 | TSubclassOf playerPositionRowClass; 28 | 29 | UFUNCTION() 30 | void repopulateInfoBox(); 31 | 32 | void fillInfoBoxWith(const TTuple& aPlayerNameAndPositionTuple); 33 | 34 | FTimerHandle repopulateBoxTimer; 35 | 36 | public: 37 | virtual bool Initialize() override; 38 | int rowsQuantity(); 39 | 40 | }; 41 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/SingleplayerMenu.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UI/Menu.h" 7 | #include "SingleplayerMenu.generated.h" 8 | 9 | class UMapSelectorWidget; 10 | class UButton; 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class PROJECTR_API USingleplayerMenu : public UMenu 16 | { 17 | GENERATED_BODY() 18 | 19 | protected: 20 | void focusOnGame(); 21 | UFUNCTION() 22 | void play(); 23 | 24 | UFUNCTION() 25 | void goBack(); 26 | 27 | UPROPERTY(meta = (BindWidget)) 28 | UButton* playButton; 29 | 30 | UPROPERTY(meta = (BindWidget)) 31 | UButton* goBackButton; 32 | 33 | UPROPERTY(meta = (BindWidget)) 34 | UMapSelectorWidget* mapListing; 35 | 36 | public: 37 | virtual bool Initialize() override; 38 | 39 | FVector2D playButtonAbsoluteCenterPosition(); 40 | 41 | FVector2D goBackButtonAbsoluteCenterPosition(); 42 | }; 43 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/StringButtonScrollBox.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Components/ScrollBox.h" 7 | #include "StringButtonScrollBox.generated.h" 8 | 9 | class ULobbyMenu; 10 | class ALobbyGameState; 11 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSelectedStringUpdateEvent, FString, anUpdatedSelectedString); 12 | 13 | 14 | class UStringHolderButton; 15 | /** 16 | * 17 | */ 18 | UCLASS() 19 | class PROJECTR_API UStringButtonScrollBox : public UUserWidget 20 | { 21 | GENERATED_BODY() 22 | 23 | protected: 24 | UPROPERTY(meta = (BindWidget)) 25 | UScrollBox* scrollBoxWidget; 26 | 27 | UPROPERTY() 28 | UStringHolderButton* selectedChild; 29 | 30 | UPROPERTY(EditDefaultsOnly, Category = "String Holder Button Class") 31 | TSubclassOf stringHolderButtonClass; 32 | 33 | UPROPERTY(BlueprintAssignable, Category = "Events") 34 | FSelectedStringUpdateEvent mapUpdateEvent; 35 | 36 | UFUNCTION() 37 | void fireSelectedStringUpdateEvent(); 38 | 39 | 40 | public: 41 | virtual bool Initialize() override; 42 | void populateBoxWith(TArray aBunchOfStrings); 43 | int stringButtonsQuantity(); 44 | FString selectedString(); 45 | void childClicked(UStringHolderButton* aChild); 46 | 47 | void subscribeToSelectedStringUpdate(ALobbyGameState* aGameState); 48 | void subscribeToSelectedStringUpdate(ULobbyMenu* aLobbyMenu); 49 | }; 50 | -------------------------------------------------------------------------------- /Source/ProjectR/Public/UI/StringHolderButton.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "Components/Button.h" 8 | #include "Components/TextBlock.h" 9 | #include "StringHolderButton.generated.h" 10 | 11 | 12 | /** 13 | * 14 | */ 15 | UCLASS() 16 | class PROJECTR_API UStringHolderButton : public UUserWidget 17 | { 18 | GENERATED_BODY() 19 | 20 | public: 21 | virtual bool Initialize() override; 22 | void store(FString aString); 23 | FString storedString(); 24 | 25 | FVector2D buttonCoordinates(); 26 | 27 | protected: 28 | 29 | UPROPERTY(meta = (BindWidget)) 30 | UButton* textButton; 31 | 32 | UPROPERTY(meta = (BindWidget)) 33 | UTextBlock* textHolder; 34 | 35 | UFUNCTION() 36 | void buttonClickedEvent(); 37 | }; -------------------------------------------------------------------------------- /Source/ProjectREditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class ProjectREditorTarget : TargetRules 7 | { 8 | public ProjectREditorTarget( TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Editor; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | ExtraModuleNames.AddRange( new string[] { "ProjectR", "TestingModule" } ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Commands/CommonPIECommands.h: -------------------------------------------------------------------------------- 1 | // // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Misc/AutomationTest.h" 7 | 8 | /** 9 | * This file contains common latent commands necessary for tests. 10 | */ 11 | 12 | /** 13 | * Spawns the world gamemode default pawn. 14 | */ 15 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnGameModeDefaultPawn); 16 | 17 | /** 18 | * Spawn an actor in while in a PIE session. 19 | */ 20 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FSpawnInPIEAnActorOfClass, UClass*, anActorClass, const FTransform, actorTransform); 21 | 22 | 23 | /** 24 | * Spawn an actor in while in editor. 25 | */ 26 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FSpawnInEditorAnActorOfClass, UClass*, anActorClass, const FTransform, actorTransform); 27 | 28 | 29 | /** 30 | * Spawn a local player in while in a PIE session. 31 | */ 32 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnLocalPlayerInPIE); 33 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Commands/NetworkCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "NetworkCommands.h" 5 | 6 | #include "LevelEditor.h" 7 | #include "Editor/UnrealEdEngine.h" 8 | #include "UnrealEdGlobals.h" 9 | #include "../Utilities/NetworkedPIESessionUtilities.h" 10 | 11 | 12 | bool FStartNetworkedPIESession::Update() 13 | { 14 | FLevelEditorModule& LevelEditorModule = FModuleManager::Get().GetModuleChecked(TEXT("LevelEditor")); 15 | 16 | ULevelEditorPlaySettings* playSettings = GetMutableDefault(); 17 | playSettings->SetPlayNumberOfClients(numParticipants); 18 | playSettings->SetPlayNetMode(netMode); 19 | 20 | FRequestPlaySessionParams sessionParameters; 21 | sessionParameters.DestinationSlateViewport = LevelEditorModule.GetFirstActiveViewport();//sets the server viewport in there. Otherwise, a window is created for the server. 22 | sessionParameters.EditorPlaySettings = playSettings; 23 | 24 | GUnrealEd->RequestPlaySession(sessionParameters); 25 | 26 | return true; 27 | } 28 | 29 | 30 | bool FServerSpawnActorOfClass::Update() 31 | { 32 | if (GEditor->IsPlayingSessionInEditor()) 33 | { 34 | return NetworkedPIESessionUtilities::spawnActorInServerWorldOfClass(anActorClass, actorTransform, clientQuantity); 35 | } 36 | return false; 37 | } 38 | 39 | 40 | bool FServerSpawnPawnOfClass::Update() 41 | { 42 | if (GEditor->IsPlayingSessionInEditor()) 43 | { 44 | return NetworkedPIESessionUtilities::spawnPawnInServerWorldOfClass(aPawnClass, pawnTransform, clientQuantity); 45 | } 46 | return false; 47 | } 48 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Commands/NetworkCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Misc/AutomationTest.h" 7 | 8 | /** 9 | * This file contains common latent commands necessary for networked tests. 10 | */ 11 | 12 | /** 13 | * Start a networked PIE session (non simulated) 14 | */ 15 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FStartNetworkedPIESession, int32, numParticipants, EPlayNetMode, netMode); 16 | 17 | 18 | /** 19 | * Spawn an actor in server while in a networked PIE session (non simulated). 20 | * It also looks for the client controller and makes it the actor's owner. 21 | */ 22 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FServerSpawnActorOfClass, UClass*, anActorClass, FTransform, actorTransform, int, clientQuantity); 23 | 24 | 25 | /** 26 | * Spawn a pawn in server while in a networked PIE session (non simulated). 27 | * It also looks for the client controller, makes it the pawn's owner and possess it. 28 | */ 29 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FServerSpawnPawnOfClass, UClass*, aPawnClass, FTransform, pawnTransform, int, clientQuantity); -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Commands/PlaceholderTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | 5 | 6 | 7 | 8 | #if WITH_DEV_AUTOMATION_TESTS 9 | 10 | #include "PlaceholderTestCommands.h" 11 | 12 | //Test preparation commands: 13 | 14 | 15 | 16 | //Test check commands: 17 | 18 | 19 | 20 | #endif //WITH_DEV_AUTOMATION_TESTS 21 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Commands/PlaceholderTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | #if WITH_DEV_AUTOMATION_TESTS 12 | 13 | 14 | //Test preparation commands: 15 | 16 | 17 | 18 | //Test check commands: 19 | 20 | 21 | 22 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/DeloreanReplicationMachineMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "DeloreanReplicationMachineMOCK.h" 5 | 6 | std::deque& UDeloreanReplicationMachineMOCK::movementHistoryReference() 7 | { 8 | return movementHistory; 9 | } 10 | 11 | void UDeloreanReplicationMachineMOCK::addToHistory(FMovementData aMovement) 12 | { 13 | addToMovementHistory(aMovement); 14 | } 15 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/DeloreanReplicationMachineMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/DeloreanReplicationMachine.h" 7 | #include "DeloreanReplicationMachineMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API UDeloreanReplicationMachineMOCK : public UDeloreanReplicationMachine 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | std::deque& movementHistoryReference(); 19 | void addToHistory(FMovementData aMovement); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/LapManagerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "LapManager/LapManager.h" 7 | #include "LapManagerMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ALapManagerMOCK : public ALapManager 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | bool defaultLapPhaseIsFinalLapPhase(); 19 | bool InitialLapCountSetToZero(); 20 | bool jetsMovedFromInitialToIntermediatePhase(); 21 | void makeJetsPhaseIntermediate(); 22 | bool jetsMovedFromIntermediateToFinalPhase(); 23 | void makeJetsPhaseFinal(); 24 | bool jetsMovedFromFinalToInitialPhase(); 25 | void changeLapTo(int aLapNumber, AJet* anAffectedJet); 26 | void makeJetsPhaseInitial(); 27 | bool lastCrossedPhaseIs(UClass* aPhaseClass, AJet* anAffectedJet); 28 | void makeLastCrossedPhaseFinal(); 29 | UClass* currentRecordedPhaseClassOf(AJet* aJet); 30 | }; 31 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/LapPhaseMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "LapPhaseMOCK.h" 5 | 6 | bool ALapPhaseMOCK::hasAStaticMeshComponent() 7 | { 8 | return phaseWall ? true : false; 9 | } 10 | 11 | bool ALapPhaseMOCK::hasAStaticMeshAssociated() 12 | { 13 | return phaseWall->GetStaticMesh() ? true : false; 14 | } 15 | 16 | bool ALapPhaseMOCK::phaseWallIsRootComponent() 17 | { 18 | return phaseWall == RootComponent ? true : false; 19 | } 20 | 21 | bool ALapPhaseMOCK::hasCollisionEnabledToQueryOnly() 22 | { 23 | return RootComponent->GetCollisionEnabled() == ECollisionEnabled::QueryOnly ? true : false; 24 | } 25 | 26 | bool ALapPhaseMOCK::overlapsWithPawnChannel() 27 | { 28 | return RootComponent->GetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn) == ECR_Overlap ? true : false; 29 | } 30 | 31 | bool ALapPhaseMOCK::objectTypeIsWorldStatic() 32 | { 33 | return RootComponent->GetCollisionObjectType() == ECollisionChannel::ECC_WorldStatic ? true : false; 34 | } 35 | 36 | bool ALapPhaseMOCK::generatesOverlapEvents() 37 | { 38 | return phaseWall->GetGenerateOverlapEvents(); 39 | } 40 | 41 | bool ALapPhaseMOCK::IsHiddenInGame() 42 | { 43 | return phaseWall->bHiddenInGame; 44 | } 45 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/LapPhaseMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "LapPhases/LapPhase.h" 7 | #include "LapPhaseMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ALapPhaseMOCK : public ALapPhase 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | bool hasAStaticMeshComponent(); 19 | bool hasAStaticMeshAssociated(); 20 | bool phaseWallIsRootComponent(); 21 | bool hasCollisionEnabledToQueryOnly(); 22 | bool overlapsWithPawnChannel(); 23 | bool objectTypeIsWorldStatic(); 24 | bool generatesOverlapEvents(); 25 | bool IsHiddenInGame(); 26 | }; 27 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/MotorStateManagerMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "MotorStateManagerMOCK.h" 5 | 6 | UMotorState* AMotorStateManagerMOCK::currentState() 7 | { 8 | return motorState; 9 | } 10 | 11 | void AMotorStateManagerMOCK::setOwningJet(AJet* owner) 12 | { 13 | owningJet = owner; 14 | } 15 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/MotorStateManagerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/MotorStates/MotorStateManager.h" 7 | #include "MotorStateManagerMOCK.generated.h" 8 | 9 | 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class TESTINGMODULE_API AMotorStateManagerMOCK : public AMotorStateManager 15 | { 16 | GENERATED_BODY() 17 | 18 | public: 19 | UMotorState* currentState(); 20 | 21 | template 22 | void changeMotorStateTo(); 23 | 24 | void setOwningJet(AJet* owner); 25 | }; 26 | 27 | template 28 | void AMotorStateManagerMOCK::changeMotorStateTo() 29 | { 30 | updateStateTo(); 31 | } 32 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/ProjectRPlayerControllerMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "ProjectRPlayerControllerMOCK.h" 5 | #include "UI/PauseMenu.h" 6 | 7 | bool AProjectRPlayerControllerMOCK::pauseMenuIsInViewport() 8 | { 9 | if(pauseMenu && pauseMenu->IsInViewport()) 10 | { 11 | return true; 12 | } 13 | return false; 14 | } 15 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/ProjectRPlayerControllerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "PlayerController/ProjectRPlayerController.h" 7 | #include "ProjectRPlayerControllerMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API AProjectRPlayerControllerMOCK : public AProjectRPlayerController 14 | { 15 | GENERATED_BODY() 16 | public: 17 | bool pauseMenuIsInViewport(); 18 | 19 | }; 20 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceBeginningStageMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RaceBeginningStageMOCK.h" 5 | #include "TimerManager.h" 6 | 7 | bool ARaceBeginningStageMOCK::hasTimerActive() 8 | { 9 | return GetWorldTimerManager().IsTimerActive(countdownTimer) || GetWorldTimerManager().IsTimerPaused(countdownTimer) || GetWorldTimerManager().IsTimerPending(countdownTimer); 10 | } 11 | 12 | void ARaceBeginningStageMOCK::loadAnnouncers() 13 | { 14 | loadAnnouncerOnControllers(); 15 | } 16 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceBeginningStageMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceBeginningStage.h" 7 | #include "RaceBeginningStageMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ARaceBeginningStageMOCK : public ARaceBeginningStage 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | bool hasTimerActive(); 19 | 20 | void loadAnnouncers(); 21 | }; 22 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceGameModeMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RaceGameModeMOCK.h" 5 | 6 | #include "Kismet/GameplayStatics.h" 7 | #include "Track/TrackGenerator.h" 8 | #include "LapPhases/InitialLapPhase.h" 9 | #include "GameMode/RaceStages/RaceStage.h" 10 | #include "LapManagerMOCK.h" 11 | 12 | void ARaceGameModeMOCK::StartPlay() 13 | { 14 | Super::Super::StartPlay(); 15 | 16 | gameWorld = GetWorld(); 17 | AActor* soonToBeTrack = UGameplayStatics::GetActorOfClass(gameWorld, ATrackGenerator::StaticClass()); 18 | track = Cast(soonToBeTrack); 19 | AActor* soonToBeInitialPhase = UGameplayStatics::GetActorOfClass(gameWorld, AInitialLapPhase::StaticClass()); 20 | initialPhase = Cast(soonToBeInitialPhase); 21 | 22 | stage = gameWorld->SpawnActor(); 23 | } 24 | 25 | void ARaceGameModeMOCK::changeStageTo(ARaceStage* anotherStage) 26 | { 27 | ARaceStage* oldStage = stage; 28 | stage = anotherStage; 29 | oldStage->Destroy(); 30 | } 31 | 32 | ARaceStage* ARaceGameModeMOCK::currentStage() 33 | { 34 | return stage; 35 | } 36 | 37 | void ARaceGameModeMOCK::addToRunningJets(AJet* aJet) 38 | { 39 | runningJets.Add(aJet); 40 | } 41 | 42 | void ARaceGameModeMOCK::createLapManagerMOCK() 43 | { 44 | lapManager = GetWorld()->SpawnActor(); 45 | lapManager->subscribeToLapCross(this); 46 | } 47 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceGameModeMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceGameMode.h" 7 | #include "RaceGameModeMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ARaceGameModeMOCK : public ARaceGameMode 14 | { 15 | GENERATED_BODY() 16 | public: 17 | void StartPlay() override; 18 | 19 | void changeStageTo(ARaceStage* anotherStage); 20 | 21 | ARaceStage* currentStage(); 22 | 23 | void addToRunningJets(AJet* aJet); 24 | 25 | void createLapManagerMOCK(); 26 | }; 27 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceRunningStageMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RaceRunningStageMOCK.h" 5 | #include "TimerManager.h" 6 | 7 | bool ARaceRunningStageMOCK::announcerRemovalDelayStarted() 8 | { 9 | return GetWorldTimerManager().IsTimerActive(announcerRemovalDelay) || GetWorldTimerManager().IsTimerPaused(announcerRemovalDelay) || GetWorldTimerManager().IsTimerPending(announcerRemovalDelay); 10 | } 11 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceRunningStageMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceRunningStage.h" 7 | #include "RaceRunningStageMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ARaceRunningStageMOCK : public ARaceRunningStage 14 | { 15 | GENERATED_BODY() 16 | 17 | 18 | public: 19 | bool announcerRemovalDelayStarted(); 20 | }; 21 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceStageMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RaceStageMOCK.h" 5 | #include "GameMode/RaceGameMode.h" 6 | 7 | bool ARaceStageMOCK::raceModeIsSubscribed() 8 | { 9 | return stageEndedEvent.IsBound(); 10 | } 11 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/RaceStageMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameMode/RaceStages/RaceStage.h" 7 | #include "RaceStageMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ARaceStageMOCK : public ARaceStage 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | bool raceModeIsSubscribed(); 19 | }; 20 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/SessionManagerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Session/SessionManager.h" 7 | #include "SessionManagerMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API USessionManagerMOCK : public USessionManager 14 | { 15 | GENERATED_BODY() 16 | 17 | 18 | public: 19 | 20 | IOnlineSubsystem* retrieveSessionSubsystem(); 21 | IOnlineSessionPtr retrieveSessionInterface(); 22 | 23 | void setArbitrarySessionSearchResults(TSharedPtr anArbitrarySessionSearch); 24 | 25 | void configureSubsystemAndInterface(); 26 | 27 | bool isBoundToFOnCreateSessionCompleteDelegate(); 28 | 29 | bool isBoundToFOnStartSessionCompleteDelegate(); 30 | 31 | bool isBoundToFOnFindSessionsCompleteDelegate(); 32 | 33 | bool isBoundToFOnJoinSessionCompleteDelegate(); 34 | 35 | 36 | bool FOnCreateSessionCompleteDelegateHandleIsSet(); 37 | 38 | bool FOnStartSessionCompleteDelegateHandleIsSet(); 39 | 40 | bool FOnFindSessionsCompleteDelegateHandleIsSet(); 41 | 42 | bool FOnJoinSessionCompleteDelegateHandleIsSet(); 43 | }; 44 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/SteerStateManagerMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "SteerStateManagerMOCK.h" 5 | 6 | USteerState* ASteerStateManagerMOCK::currentState() 7 | { 8 | return steerState; 9 | } 10 | 11 | void ASteerStateManagerMOCK::setOwningJet(AJet* owner) 12 | { 13 | owningJet = owner; 14 | } 15 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/SteerStateManagerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Jet/SteerStates/SteerStateManager.h" 7 | #include "SteerStateManagerMOCK.generated.h" 8 | 9 | class USteerState; 10 | /** 11 | * 12 | */ 13 | UCLASS() 14 | class TESTINGMODULE_API ASteerStateManagerMOCK : public ASteerStateManager 15 | { 16 | GENERATED_BODY() 17 | 18 | public: 19 | USteerState* currentState(); 20 | 21 | void setOwningJet(AJet* owner); 22 | }; 23 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/TrackManagerMOCK.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "TrackManagerMOCK.h" 5 | 6 | TSet ATrackManagerMOCK::trackGenerators() 7 | { 8 | return trackGeneratorSet; 9 | } 10 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Mocks/TrackManagerMOCK.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Track/TrackManager.h" 7 | #include "TrackManagerMOCK.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class TESTINGMODULE_API ATrackManagerMOCK : public ATrackManager 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | TSet trackGenerators(); 19 | }; 20 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AcceleratingMotorState/AcceleratingMotorStateTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "AcceleratingMotorStateTest.h" 7 | #include "Tests/AutomationEditorCommon.h" 8 | #include "Jet/MotorStates/AcceleratingMotorState.h" 9 | 10 | #include "../AcceleratingMotorState/AcceleratingMotorStateTestCommands.h" 11 | #include "../Jet/JetTestCommands.h" 12 | 13 | bool FUAcceleratingMotorStateIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 14 | { 15 | UAcceleratingMotorState* testAccelerating = NewObject(); 16 | 17 | TestNotNull(TEXT("The Accelerating motor state shouldn't be null when instantiated"), testAccelerating); 18 | 19 | return true; 20 | } 21 | 22 | 23 | bool FUAcceleratingMotorStateActivateAcceleratesMotorDriveTest::RunTest(const FString& Parameters) 24 | { 25 | establishInitialMapDirectoryTo(FString("/Game/Tests/TestMaps/VoidWorld")); 26 | establishTestMessageTo(FString("The motor drive component's Jet X location should increase after an acceleration is added (after ticking).")); 27 | establishTickLimitTo(3); 28 | 29 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(retrieveInitialMapDirectory())); 30 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 31 | 32 | 33 | 34 | 35 | ADD_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateAcceleratingMotorState); 36 | 37 | ADD_LATENT_AUTOMATION_COMMAND(FCheckAJetLocation(this)); 38 | 39 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 40 | return true; 41 | } 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AcceleratingMotorState/AcceleratingMotorStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | 21 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUAcceleratingMotorStateIsntNullWhenInstantiatedTest, 22 | "ProjectR.AcceleratingMotorState Tests.Unit.000: Isn't null when instantiated", 23 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 24 | 25 | 26 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUAcceleratingMotorStateActivateAcceleratesMotorDriveTest, FSimplePIETestBase, 27 | "ProjectR.AcceleratingMotorState Tests.Integration.001: activate accelerates the motor drive component passed as parameter", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AcceleratingMotorState/AcceleratingMotorStateTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | 5 | #if WITH_DEV_AUTOMATION_TESTS 6 | 7 | #include "AcceleratingMotorStateTestCommands.h" 8 | #include "Jet/MotorStates/AcceleratingMotorState.h" 9 | #include "../../Utilities/PIESessionUtilities.h" 10 | #include "../../Mocks/JetMOCK.h" 11 | 12 | 13 | //Test preparation commands: 14 | 15 | 16 | bool FSpawningAJetAndActivateAcceleratingMotorState::Update() 17 | { 18 | if (GEditor->IsPlayingSessionInEditor()) 19 | { 20 | PIESessionUtilities sessionUtilities = PIESessionUtilities(); 21 | 22 | 23 | UWorld* testWorld = sessionUtilities.defaultPIEWorld(); 24 | 25 | AJetMOCK* testJet = sessionUtilities.spawnInPIEAnInstanceOf(); 26 | 27 | UAcceleratingMotorState* testState = NewObject(); 28 | 29 | testState->activate(testJet->motorDriveComponent()); 30 | 31 | return true; 32 | } 33 | return false; 34 | } 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | //Test check commands: 47 | 48 | 49 | 50 | 51 | 52 | 53 | #endif //WITH_DEV_AUTOMATION_TESTS 54 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AcceleratingMotorState/AcceleratingMotorStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateAcceleratingMotorState); 18 | 19 | 20 | 21 | //Test check commands: 22 | 23 | 24 | 25 | #endif //WITH_DEV_AUTOMATION_TESTS 26 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AnnouncerUI/AnnouncerUITest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "AnnouncerUITest.h" 8 | #include "UI/AnnouncerUI.h" 9 | 10 | 11 | bool FAAnnouncerUIIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 12 | { 13 | UAnnouncerUI* testAnnouncer = NewObject(); 14 | 15 | TestNotNull(TEXT("Shouldn't be null when instantiated."), testAnnouncer); 16 | 17 | return true; 18 | } 19 | 20 | 21 | 22 | 23 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/AnnouncerUI/AnnouncerUITest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAAnnouncerUIIsntNullWhenInstantiatedTest, 20 | "ProjectR.AnnouncerUI Tests.Unit.000: Isn't null when instantiated", 21 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/CenterSteerState/CenterSteerStateTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "CenterSteerStateTest.h" 8 | #include "Jet/SteerStates/CenterSteerState.h" 9 | 10 | 11 | bool FUCenterSteerStateIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 12 | { 13 | UCenterSteerState* testState = NewObject(); 14 | 15 | TestNotNull("Shouldn't be null when instantiated.", testState); 16 | 17 | return true; 18 | } 19 | 20 | 21 | 22 | 23 | 24 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/CenterSteerState/CenterSteerStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUCenterSteerStateIsntNullWhenInstantiatedTest, 21 | "ProjectR.CenterSteerState Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/FinalLapPhase/FinalLapPhaseTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "FinalLapPhaseTest.h" 7 | #include "LapPhases/FinalLapPhase.h" 8 | #include "LapPhases/InitialLapPhase.h" 9 | 10 | 11 | bool FAFinalLapPhaseIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 12 | { 13 | AFinalLapPhase* testFinalPhase = NewObject(); 14 | 15 | TestNotNull(TEXT("The final lap phase shouldn't be null after instantiating it."), testFinalPhase); 16 | 17 | return true; 18 | } 19 | 20 | 21 | bool FAFinalLapPhaseUpdateStateReturnsInitialLapPhaseIfItsPassedAsParameterTest::RunTest(const FString& Parameters) 22 | { 23 | AFinalLapPhase* testFinalLapPhase = NewObject(); 24 | AInitialLapPhase* testInitialLapPhase = NewObject(); 25 | 26 | TestTrue(TEXT("The final lap phase should return the InitialLapPhase instance if that is passed as parameter."), testFinalLapPhase->updatePhase(testInitialLapPhase) == testInitialLapPhase); 27 | 28 | return true; 29 | } 30 | 31 | 32 | bool FAFinalLapPhaseUpdateStateReturnsItselfIfInitialLapPhaseIsntPassedAsParameterTest::RunTest(const FString& Parameters) 33 | { 34 | AFinalLapPhase* testFinalPhase = NewObject(); 35 | ALapPhase* parameter = NewObject(); 36 | bool isntInitialLapPhase = parameter->GetClass() != AInitialLapPhase::StaticClass(); 37 | 38 | TestTrue(TEXT("The final phase should return itself if a InitialLapPhase instance isn't passed as parameter of updateState."), isntInitialLapPhase && testFinalPhase->updatePhase(parameter) == testFinalPhase); 39 | 40 | return true; 41 | } 42 | 43 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/FinalLapPhase/FinalLapPhaseTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAFinalLapPhaseIsntNullWhenInstantiatedTest, 20 | "ProjectR.FinalLapPhase Tests.Unit.000: Isn't null when instantiated", 21 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 22 | 23 | 24 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAFinalLapPhaseUpdateStateReturnsInitialLapPhaseIfItsPassedAsParameterTest, 25 | "ProjectR.FinalLapPhase Tests.Unit.001: If a AInitialLapPhase instance is passed to updateState, it returns that instance", 26 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 27 | 28 | 29 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAFinalLapPhaseUpdateStateReturnsItselfIfInitialLapPhaseIsntPassedAsParameterTest, 30 | "ProjectR.FinalLapPhase Tests.Unit.002: Returns itself if a AFinalLapPhase instance isn't passed as parameter in updateState", 31 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 32 | 33 | 34 | 35 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/InitialLapPhase/InitialLapPhaseTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | 7 | /** 8 | * Each one of this tests should test something of the project class that this test class references to. 9 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 10 | * 11 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 12 | * TestName should express what you expect from a test given a scenario. 13 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 14 | */ 15 | 16 | #include "Misc/AutomationTest.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAInitialLapPhaseIsntNullWhenInstantiatedTest, 21 | "ProjectR.InitialLapPhase Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAInitialLapPhaseUpdateStateReturnsIntermediateLapPhaseIfItsPassedAsParameterTest, 26 | "ProjectR.InitialLapPhase Tests.Unit.001: If a AIntermediateLapPhase instance is passed to updateState, it returns that instance", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAInitialLapPhaseUpdateStateReturnsItselfIfIntermediateLapPhaseIsntPassedAsParameterTest, 31 | "ProjectR.InitialLapPhase Tests.Unit.002: Returns itself if a AIntermediateLapPhase instance isn't passed as parameter in updateState", 32 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 33 | 34 | 35 | 36 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/IntermediateLapPhaseTest/IntermediateLapPhaseTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAIntermediateLapPhaseIsntNullWhenInstantiatedTest, 20 | "ProjectR.IntermediateLapPhase Tests.Unit.000: Isn't null when instantiated", 21 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 22 | 23 | 24 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAIntermediateLapPhaseUpdateStateReturnsFinalLapPhaseIfItsPassedAsParameterTest, 25 | "ProjectR.IntermediateLapPhase Tests.Unit.001: If a AFinalLapPhase instance is passed to updateState, it returns that instance", 26 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 27 | 28 | 29 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAIntermediateLapPhaseUpdateStateReturnsItselfIfFinalLapPhaseIsntPassedAsParameterTest, 30 | "ProjectR.IntermediateLapPhase Tests.Unit.002: Returns itself if a AFinalLapPhase instance isn't passed as parameter in updateState", 31 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 32 | 33 | 34 | 35 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LanMultiplayerMenu/LanMultiplayerMenuTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | class ULanMultiplayerMenu; 22 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckLanMultiplayerMenuClickGoBackRemovesFromViewport, ULanMultiplayerMenu*, lanMultiplayerMenuInstance, bool, menuIsInstantiated, FSimplePIETestBase*, test); 23 | 24 | 25 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckLanMultiplayerMenuClickGoBackBringsMainMenu, ULanMultiplayerMenu*, lanMultiplayerMenuInstance, FSimplePIETestBase*, test); 26 | 27 | 28 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckLanMultiplayerMenuClickCreateSessionBringsLobby, ULanMultiplayerMenu*, lanMultiplayerMenuInstance, bool, lanMenuInstantiated, FSimplePIETestBase*, test); 29 | 30 | 31 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LapPhase/LapPhaseTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | #if WITH_DEV_AUTOMATION_TESTS 12 | 13 | //Test preparation commands: 14 | 15 | 16 | 17 | 18 | 19 | 20 | //Test check commands: 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLapPhaseCollisionEnabled, FAutomationTestBase*, test); 23 | 24 | 25 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLapPhaseCollisionResponse, FAutomationTestBase*, test); 26 | 27 | 28 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLapPhaseObjectType, FAutomationTestBase*, test); 29 | 30 | 31 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLapPhaseOverlapEvents, FAutomationTestBase*, test); 32 | 33 | 34 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LeftSteerState/LeftSteerStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | 21 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FULeftSteerStateIsntNullWhenInstantiatedTest, 22 | "ProjectR.LeftSteerState Tests.Unit.000: Isn't null when instantiated", 23 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 24 | 25 | 26 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FULeftSteerStateActivateTurnsLeftSteeringTest, FSimplePIETestBase, 27 | "ProjectR.LeftSteerState Tests.Integration.001: activate steers left the steering component passed as parameter", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LeftSteerState/LeftSteerStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckAJetSteersLeft, FVector, previousLocation, FSimplePIETestBase*, test); 23 | 24 | 25 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LobbyGameState/LobbyGameStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FALobbyGameStateIsntNullWhenInstantiatedTest, 21 | "ProjectR.LobbyGameState Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FALobbyGameStateClickingReturnGoesToMainMenuTest, FSimplePIETestBase, 26 | "ProjectR.LobbyGameState Tests.Integration.001: Exists in the lobby map", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FALobbyGameStateUpdatingSelectedMapUpdatesMapOfLobbyMenuClientTest, FSimplePIETestBase, 31 | "ProjectR.LobbyGameState Tests.Replication.002: Updating selected map updates the client lobby menu", 32 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LobbyGameState/LobbyGameStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLobbyGameStateExistsInLobby, FSimplePIETestBase*, test); 23 | 24 | 25 | DEFINE_LATENT_AUTOMATION_COMMAND_FOUR_PARAMETER(FCheckLobbyGameStateUpdatesClientLobbyMenus, FString, selectedMap, bool, needsToSelectMap, int, clientQuantity, FSimplePIETestBase*, test); 26 | 27 | 28 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/LocalMultiplayerMenu/LocalMultiplayerMenuTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | class ULocalMultiplayerMenu; 15 | 16 | //Test preparation commands: 17 | 18 | 19 | 20 | //Test check commands: 21 | 22 | 23 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckLocalMultiplayerMenuClickGoBackRemovesFromViewport, ULocalMultiplayerMenu*, localMultiplayerMenuInstance, bool, isMenuInstanciated, FSimplePIETestBase*, test); 24 | 25 | 26 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckLocalMultiplayerMenuClickGoBackBringsMainMenu, ULocalMultiplayerMenu*, localMultiplayerMenuInstance, FSimplePIETestBase*, test); 27 | 28 | 29 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckLocalMultiplayerMenuClickPlaySetsPlayers, ULocalMultiplayerMenu*, localMultiplayerMenuInstance, int, aSelectedNumberOfPlayers, FSimplePIETestBase*, test); 30 | 31 | 32 | DEFINE_LATENT_AUTOMATION_COMMAND_FOUR_PARAMETER(FCheckLocalMultiplayerMenuClickMapAndPlayButtonChangesMap, ULocalMultiplayerMenu*, localMultiplayerMenuInstance, bool, menuNeedsInstantiation, bool, hasSelectedMap, FSimplePIETestBase*, test); 33 | 34 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MapSelectorWidget/MapSelectorWidgetTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "MapSelectorWidgetTest.h" 7 | #include "UI/MapSelectorWidget.h" 8 | #include "Tests/AutomationEditorCommon.h" 9 | #include "../../Commands/CommonPIECommands.h" 10 | #include "MapSelectorWidgetTestCommands.h" 11 | 12 | 13 | 14 | bool FUMapSelectorWidgetIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 15 | { 16 | UMapSelectorWidget* testSelector = NewObject(); 17 | 18 | TestNotNull(TEXT("Isn't null when instantiated."), testSelector); 19 | 20 | return true; 21 | } 22 | 23 | 24 | bool FUMapSelectorWidgetCreatesAmountOfButtonsAsMapsFoundTest::RunTest(const FString& Parameters) 25 | { 26 | FString testWorldName = FString("/Game/Tests/TestMaps/VoidWorld-MapSelectorContainer"); 27 | establishTestMessageTo(FString("The map selector widget should make as many string holder buttons as maps in the specified folder.")); 28 | establishTickLimitTo(3); 29 | 30 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(testWorldName)); 31 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 32 | 33 | 34 | 35 | 36 | ADD_LATENT_AUTOMATION_COMMAND(FSpawnGameModeDefaultPawn); 37 | ADD_LATENT_AUTOMATION_COMMAND(FCheckMapSelectorCreatesButtonsAsMapsFound(this)); 38 | 39 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 40 | return true; 41 | } 42 | 43 | 44 | 45 | 46 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MapSelectorWidget/MapSelectorWidgetTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUMapSelectorWidgetIsntNullWhenInstantiatedTest, 21 | "ProjectR.MapSelectorWidget Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUMapSelectorWidgetCreatesAmountOfButtonsAsMapsFoundTest, FSimplePIETestBase, 26 | "ProjectR.MapSelectorWidget Tests.Unit.001: Creates as much string holder buttons as maps found", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MapSelectorWidget/MapSelectorWidgetTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckMapSelectorCreatesButtonsAsMapsFound, FSimplePIETestBase*, test); 23 | 24 | 25 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MixedMotorState/MixedMotorStateTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "MixedMotorStateTest.h" 7 | #include "Tests/AutomationEditorCommon.h" 8 | #include "Jet/MotorStates/MixedMotorState.h" 9 | 10 | #include "MixedMotorStateTestCommands.h" 11 | 12 | bool FUMixedMotorStateIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 13 | { 14 | UMixedMotorState* testMixed = NewObject(); 15 | 16 | TestNotNull(TEXT("The Mixed motor state shouldn't be null when instantiated."), testMixed); 17 | 18 | return true; 19 | } 20 | 21 | 22 | bool FUMixedMotorStateActivateAcceleratesMotorDriveTest::RunTest(const FString& Parameters) 23 | { 24 | establishInitialMapDirectoryTo(FString("/Game/Tests/TestMaps/VoidWorld")); 25 | establishTestMessageTo(FString("Activating the mixed state should accelerate and brake the jet.")); 26 | establishTickLimitTo(3); 27 | 28 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(retrieveInitialMapDirectory())); 29 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 30 | 31 | 32 | 33 | 34 | ADD_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateMixedMotorState); 35 | 36 | float previousSpeed = 0; 37 | ADD_LATENT_AUTOMATION_COMMAND(FCheckMixedStateActivation(previousSpeed, this)); 38 | 39 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 40 | return true; 41 | } 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MixedMotorState/MixedMotorStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | 21 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUMixedMotorStateIsntNullWhenInstantiatedTest, 22 | "ProjectR.MixedMotorState Tests.Unit.000: Isn't null when instantiated", 23 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 24 | 25 | 26 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUMixedMotorStateActivateAcceleratesMotorDriveTest, FSimplePIETestBase, 27 | "ProjectR.MixedMotorState Tests.Integration.001: activate makes the motor drive component passed as parameter add force combining acceleration and brake values", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/MixedMotorState/MixedMotorStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | 13 | #if WITH_DEV_AUTOMATION_TESTS 14 | 15 | 16 | //Test preparation commands: 17 | 18 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateMixedMotorState); 19 | 20 | 21 | 22 | //Test check commands: 23 | 24 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckMixedStateActivation, float, previousSpeed, FSimplePIETestBase*, test); 25 | 26 | 27 | #endif //WITH_DEV_AUTOMATION_TESTS 28 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/NeutralMotorState/NeutralMotorStateTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "NeutralMotorStateTest.h" 8 | #include "Jet/MotorStates/NeutralMotorState.h" 9 | 10 | bool FUNeutralMotorStateIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 11 | { 12 | UNeutralMotorState* testNeutral = NewObject(); 13 | 14 | TestNotNull(TEXT("The Neutral motor state shouldn't be null when instantiated"), testNeutral); 15 | 16 | return true; 17 | } 18 | 19 | 20 | 21 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/NeutralMotorState/NeutralMotorStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUNeutralMotorStateIsntNullWhenInstantiatedTest, 21 | "ProjectR.NeutralMotorState Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | 26 | 27 | 28 | 29 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PauseMenu/PauseMenuTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | 20 | 21 | //Test check commands: 22 | 23 | class UPauseMenu; 24 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckPauseMenuClickReturnButtonChangesToMainMenuMap, UPauseMenu*, pauseMenuInstance, bool, menuIsInstantiated, FSimplePIETestBase*, test); 25 | 26 | 27 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckPauseMenuClickResumeButtonRemovesMenuAndResumes, UPauseMenu*, pauseMenuInstance, FSimplePIETestBase*, test); 28 | 29 | 30 | #endif //WITH_DEV_AUTOMATION_TESTS 31 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlaceholderTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "PlaceholderTest.h" 8 | 9 | 10 | bool FOneIsOneTest::RunTest(const FString& Parameters) 11 | { 12 | //One should be one. 13 | TestEqual(TEXT("one is one"), 1, 1); 14 | 15 | return true; 16 | } 17 | 18 | 19 | bool FSTwoIsTwoTest::RunTest(const FString& Parameters) 20 | { 21 | //two should be two. 22 | TestEqual(TEXT("two is two"), 2, 2); 23 | 24 | return true; 25 | } 26 | 27 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlaceholderTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | //a test 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FOneIsOneTest, 21 | "ProjectR.Placeholder Tests.Unit.000: One is one", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | //another test 26 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSTwoIsTwoTest, 27 | "ProjectR.Placeholder Tests.Unit.001: Two is two", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlayerPositionRow/PlayerPositionRowTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "PlayerPositionRowTest.h" 7 | #include "UI/PlayerPositionRow.h" 8 | #include "Tests/AutomationEditorCommon.h" 9 | #include "../../Commands/CommonPIECommands.h" 10 | #include "PlayerPositionRowTestCommands.h" 11 | 12 | 13 | 14 | 15 | bool FUPlayerPositionRowIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 16 | { 17 | UPlayerPositionRow* testRow = NewObject(); 18 | 19 | TestNotNull(FString("Shouldn't be null when instantiated"), testRow); 20 | 21 | return true; 22 | } 23 | 24 | 25 | bool FUPlayerPositionRowUpdatePlayerInfoWithUpdatesInfoTest::RunTest(const FString& Parameters) 26 | { 27 | establishInitialMapDirectoryTo(FString("/Game/Tests/TestMaps/VoidWorld-PlayerPRowContainer")); 28 | establishTestMessageTo(FString("The player position row should update its info when calling updateInfoWith.")); 29 | establishTickLimitTo(3); 30 | 31 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(retrieveInitialMapDirectory())); 32 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 33 | 34 | 35 | 36 | 37 | ADD_LATENT_AUTOMATION_COMMAND(FSpawnGameModeDefaultPawn); 38 | ADD_LATENT_AUTOMATION_COMMAND(FCheckPlayerPositionRowUpdatesWithGivenInfo(this)); 39 | 40 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 41 | return true; 42 | } 43 | 44 | 45 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlayerPositionRow/PlayerPositionRowTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUPlayerPositionRowIsntNullWhenInstantiatedTest, 21 | "ProjectR.PlayerPositionRow Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUPlayerPositionRowUpdatePlayerInfoWithUpdatesInfoTest, FSimplePIETestBase, 26 | "ProjectR.PlayerPositionRow Tests.Unit.001: updatePlayerInfoWith updates the info", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlayerPositionRow/PlayerPositionRowTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "PlayerPositionRowTestCommands.h" 7 | #include "UI/PlayerPositionRow.h" 8 | #include "../../Utilities/BlueprintWidgetContainerPawn.h" 9 | #include "../../Utilities/PIESessionUtilities.h" 10 | 11 | //Test preparation commands: 12 | 13 | 14 | 15 | //Test check commands: 16 | 17 | 18 | bool FCheckPlayerPositionRowUpdatesWithGivenInfo::Update() 19 | { 20 | if(GEditor->IsPlayingSessionInEditor()) 21 | { 22 | PIESessionUtilities sessionUtilities = PIESessionUtilities(); 23 | ABlueprintWidgetContainerPawn* testContainer = sessionUtilities.retrieveFromPIEAnInstanceOf(); 24 | 25 | if(testContainer) 26 | { 27 | UPlayerPositionRow* testRow = Cast(testContainer->retrieveWidget()); 28 | FString testPlayerName = FString("I'm you."); 29 | FString testPosition = FString("3"); 30 | 31 | testRow->updateInfoWith(testPlayerName, testPosition); 32 | bool stringsCoincident = testRow->playerName() == testPlayerName && testRow->position() == testPosition; 33 | if(stringsCoincident) 34 | { 35 | test->TestTrue(test->conditionMessage(), stringsCoincident); 36 | return true; 37 | } 38 | return test->manageTickCountTowardsLimit(); 39 | } 40 | } 41 | return false; 42 | } 43 | 44 | 45 | 46 | #endif //WITH_DEV_AUTOMATION_TESTS 47 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/PlayerPositionRow/PlayerPositionRowTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckPlayerPositionRowUpdatesWithGivenInfo, FSimplePIETestBase*, test); 23 | 24 | 25 | 26 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/ProjectRGameState/ProjectRGameStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | 13 | #if WITH_DEV_AUTOMATION_TESTS 14 | 15 | class AProjectRGameState; 16 | 17 | 18 | //Test preparation commands: 19 | 20 | 21 | 22 | 23 | 24 | //Test check commands: 25 | 26 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckGameStateUpdatesAnnouncerUIDisplayText, AProjectRGameState*, gameState, FSimplePIETestBase*, test); 27 | 28 | 29 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckServerGameStateUpdatesClientAnnouncerUIDisplayText, int, clientQuantity, FSimplePIETestBase*, test); 30 | 31 | 32 | #endif //WITH_DEV_AUTOMATION_TESTS 33 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceBeginningStage/RaceBeginningStageTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnARaceBeginningMOCK); 18 | 19 | 20 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnARaceBeginningCallCountdownStart); 21 | 22 | 23 | 24 | 25 | 26 | //Test check commands: 27 | 28 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckTimerActive, FAutomationTestBase*, test); 29 | 30 | 31 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckRunningStageSpawned, FAutomationTestBase*, test); 32 | 33 | 34 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckRaceBeginningStageLoadsAnnouncerUIs, FSimplePIETestBase*, test); 35 | 36 | 37 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckRaceBeginningStageCountdownToStartModifiesAnnouncerText, FSimplePIETestBase*, test); 38 | 39 | 40 | 41 | 42 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceEndedStage/RaceEndedStageTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "RaceEndedStageTest.h" 7 | #include "GameMode/RaceStages/RaceEndedStage.h" 8 | 9 | 10 | 11 | 12 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceEndedStage/RaceEndedStageTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RacePlayerState/RacePlayerStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | #if WITH_DEV_AUTOMATION_TESTS 12 | 13 | class ARacePlayerState; 14 | class FSimplePIETestBase; 15 | 16 | 17 | //Test preparation commands: 18 | 19 | 20 | 21 | //Test check commands: 22 | 23 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckPlayerStateUpdatesRacePlayerUICurrentLap, ARacePlayerState*, raceState, FSimplePIETestBase*, test); 24 | 25 | 26 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckPlayerStateUpdatesRacePlayerUICurrentPosition, ARacePlayerState*, raceState, FSimplePIETestBase*, test); 27 | 28 | 29 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckServerUpdatesLapReplicatesToClientRaceUI, TArray, raceStates, int, clientQuantity, FSimplePIETestBase*, test); 30 | 31 | 32 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckServerUpdatesPositionReplicatesToClientRaceUI, TArray, raceStates, int, clientQuantity, FSimplePIETestBase*, test); 33 | 34 | 35 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckServerUpdatesTotalLapsReplicatesToClientRaceUI, TArray, raceStates, int, clientQuantity, FSimplePIETestBase*, test); 36 | 37 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RacePlayerUI/RacePlayerUITest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FARacePlayerUIIsntNullWhenInstantiatedTest, 21 | "ProjectR.RacePlayerUI Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FARacePlayerUISetTotalLapsToChangesTotalLapsTextTest, FSimplePIETestBase, 26 | "ProjectR.RacePlayerUI Tests.Unit.001: setTotalLapsTo changes totalLapsText value", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | 31 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FARacePlayerUISetTotalLapsChangesTotalLapsTextOnceTest, FSimplePIETestBase, 32 | "ProjectR.RacePlayerUI Tests.Unit.002: setTotalLapsTo changes totalLapsText value once", 33 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RacePlayerUI/RacePlayerUITestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckARacePlayerUIChangesTotalLapsText, FSimplePIETestBase*, test); 22 | 23 | 24 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckARacePlayerUIChangesTotalLapsTextOnce, FSimplePIETestBase*, test); 25 | 26 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RacePreparationStage/RacePreparationStageTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FSpawnARacePreparationStage, FAutomationTestBase*, test); 18 | 19 | 20 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnARacePreparationMakeItStart); 21 | 22 | 23 | 24 | 25 | 26 | 27 | //Test check commands: 28 | 29 | 30 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckLapManagerSpawned, FAutomationTestBase*, test); 31 | 32 | 33 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckPlayersQuantityOnStart, bool, stageHasStarted, FSimplePIETestBase*, test); 34 | 35 | 36 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckPlayersPossessingJets, bool, stageHasStarted, FSimplePIETestBase*, test); 37 | 38 | 39 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckJetsInputDisabled, bool, stageHasStarted, FSimplePIETestBase*, test); 40 | 41 | 42 | 43 | 44 | 45 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceResultsUI/RaceResultsUITest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "RaceResultsUITest.h" 8 | 9 | #include "UI/RaceResultsUI.h" 10 | #include "Tests/AutomationEditorCommon.h" 11 | #include "../../Commands/CommonPIECommands.h" 12 | #include "RaceResultsUITestCommands.h" 13 | 14 | 15 | bool FURaceResultsUIIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 16 | { 17 | URaceResultsUI* testResults = NewObject(); 18 | 19 | TestNotNull(FString("Shouldn't be null when instantiated"), testResults); 20 | 21 | return true; 22 | } 23 | 24 | 25 | bool FURaceResultsUIFillsInfoBoxWithRaceGameStatePlayerStatesInfoTest::RunTest(const FString& Parameters) 26 | { 27 | establishInitialMapDirectoryTo(FString("/Game/Tests/TestMaps/VoidWorld-RaceResultsAndFriends")); 28 | establishTestMessageTo(FString("The player position row should update its info when calling updateInfoWith.")); 29 | establishTickLimitTo(3); 30 | 31 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(retrieveInitialMapDirectory())); 32 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 33 | 34 | 35 | 36 | 37 | ADD_LATENT_AUTOMATION_COMMAND(FSpawnGameModeDefaultPawn); 38 | ADD_LATENT_AUTOMATION_COMMAND(FCheckRaceResultsInfoBoxQuantitySameAsPlayerStates(this)); 39 | 40 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 41 | return true; 42 | } 43 | 44 | 45 | 46 | 47 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceResultsUI/RaceResultsUITest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FURaceResultsUIIsntNullWhenInstantiatedTest, 21 | "ProjectR.RaceResultsUI Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FURaceResultsUIFillsInfoBoxWithRaceGameStatePlayerStatesInfoTest, FSimplePIETestBase, 26 | "ProjectR.RaceResultsUI Tests.Unit.001: fills its infoBox with the RaceGameState's PlayerStates info", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceResultsUI/RaceResultsUITestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckRaceResultsInfoBoxQuantitySameAsPlayerStates, FSimplePIETestBase*, test); 23 | 24 | 25 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceRunningStage/RaceRunningStageTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnARaceRunningCallNextStage); 19 | 20 | 21 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawnARaceRunningAndStart); 22 | 23 | 24 | 25 | 26 | //Test check commands: 27 | 28 | 29 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckEndedStageSpawned, FAutomationTestBase*, test); 30 | 31 | 32 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckEndedStageSpawnedWithNoRunningJets, FAutomationTestBase*, test); 33 | 34 | 35 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckARaceRunningStartEnablesJetsInput, FSimplePIETestBase*, test); 36 | 37 | 38 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckRaceRunningStartsAnnouncerUIsRemoval, bool, controllersNeedAnnouncerLoad, FSimplePIETestBase*, test); 39 | 40 | 41 | 42 | 43 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceStage/RaceStageTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "RaceStageTest.h" 8 | 9 | #include "GameMode/RaceStages/RaceStage.h" 10 | #include "RaceStageTestCommands.h" 11 | #include "../../Commands/CommonPIECommands.h" 12 | #include "../../Mocks/RaceStageMOCK.h" 13 | 14 | #include "Tests/AutomationEditorCommon.h" 15 | 16 | 17 | 18 | bool FARaceStageIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 19 | { 20 | ARaceStage* testRaceStage = NewObject(); 21 | TestNotNull(TEXT("The race stage shouldn't be null after instantiating it."), testRaceStage); 22 | 23 | return true; 24 | } 25 | 26 | 27 | bool FARaceStageNextStageReturnsItselfTest::RunTest(const FString& Parameters) 28 | { 29 | ARaceStage* testRaceStage = NewObject(); 30 | TestTrue(TEXT("The race stage should return itself when calling nextStage."), testRaceStage->nextStage() == testRaceStage); 31 | 32 | return true; 33 | } 34 | 35 | 36 | bool FARaceStageSubscribesRaceModeToStageEndedEventTest::RunTest(const FString& Parameters) 37 | { 38 | FString testWorldName = FString("/Game/Tests/TestMaps/VoidWorld-RaceGameModeMOCK"); 39 | 40 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(testWorldName)); 41 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 42 | 43 | UClass* raceStageClass = ARaceStageMOCK::StaticClass(); 44 | ADD_LATENT_AUTOMATION_COMMAND(FSpawnInPIEAnActorOfClass(raceStageClass, FTransform())); 45 | 46 | ADD_LATENT_AUTOMATION_COMMAND(FCheckRaceModeSubscribed(this)); 47 | 48 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 49 | return true; 50 | } 51 | 52 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceStage/RaceStageTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | 17 | #if WITH_DEV_AUTOMATION_TESTS 18 | 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FARaceStageIsntNullWhenInstantiatedTest, 21 | "ProjectR.RaceStage Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FARaceStageNextStageReturnsItselfTest, 26 | "ProjectR.RaceStage Tests.Unit.001: nextStage returns itself", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | //uses a mock. 31 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FARaceStageSubscribesRaceModeToStageEndedEventTest, 32 | "ProjectR.RaceStage Tests.Integration.002: Subscribes the game mode to stageEndedEvent", 33 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceStage/RaceStageTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | 5 | 6 | 7 | 8 | #if WITH_DEV_AUTOMATION_TESTS 9 | 10 | #include "RaceStageTestCommands.h" 11 | #include "../../Mocks/RaceStageMOCK.h" 12 | 13 | #include "Tests/AutomationEditorCommon.h" 14 | #include "../../Utilities/PIESessionUtilities.h" 15 | 16 | //Test preparation commands: 17 | 18 | 19 | //Test check commands: 20 | 21 | 22 | bool FCheckRaceModeSubscribed::Update() 23 | { 24 | if (!GEditor->IsPlayingSessionInEditor()) 25 | { 26 | return false; 27 | } 28 | PIESessionUtilities sessionUtilities = PIESessionUtilities(); 29 | UWorld* testWorld = sessionUtilities.defaultPIEWorld(); 30 | 31 | ARaceStageMOCK* testRaceStage = sessionUtilities.retrieveFromPIEAnInstanceOf(); 32 | if (testRaceStage) 33 | { 34 | test->TestTrue(TEXT("Race game mode should be subscribed to the stageEndedEvent."), testRaceStage->raceModeIsSubscribed()); 35 | testWorld->bDebugFrameStepExecution = true; 36 | return true; 37 | } 38 | return false; 39 | } 40 | 41 | 42 | #endif //WITH_DEV_AUTOMATION_TESTS 43 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RaceStage/RaceStageTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | #if WITH_DEV_AUTOMATION_TESTS 12 | 13 | 14 | //Test preparation commands: 15 | 16 | 17 | 18 | 19 | 20 | //Test check commands: 21 | 22 | 23 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckRaceModeSubscribed, FAutomationTestBase*, test); 24 | 25 | 26 | 27 | 28 | 29 | 30 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/ReversingMotorState/ReversingMotorStateTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "ReversingMotorStateTest.h" 7 | #include "Jet/MotorStates/ReversingMotorState.h" 8 | 9 | #include "Tests/AutomationEditorCommon.h" 10 | #include "ReversingMotorStateTestCommands.h" 11 | #include "../Jet/JetTestCommands.h" 12 | 13 | bool FUReversingMotorStateIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 14 | { 15 | UReversingMotorState* testReversing = NewObject(); 16 | 17 | TestNotNull(TEXT("The Reversing motor state shouldn't be null when instantiated"), testReversing); 18 | 19 | return true; 20 | } 21 | 22 | 23 | bool FUReversingMotorStateActivateReversesMotorDriveTest::RunTest(const FString& Parameters) 24 | { 25 | establishInitialMapDirectoryTo(FString("/Game/Tests/TestMaps/VoidWorld")); 26 | establishTestMessageTo(FString("The motor drive's jet velocity should be negative after a brake (after ticking) from idle.")); 27 | establishTickLimitTo(3); 28 | 29 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(retrieveInitialMapDirectory())); 30 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 31 | 32 | 33 | 34 | 35 | ADD_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateReversingMotorState); 36 | 37 | ADD_LATENT_AUTOMATION_COMMAND(FCheckAJetVelocityDecrease(this)); 38 | 39 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 40 | return true; 41 | } 42 | 43 | 44 | 45 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/ReversingMotorState/ReversingMotorStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | 21 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUReversingMotorStateIsntNullWhenInstantiatedTest, 22 | "ProjectR.ReversingMotorState Tests.Unit.000: Isn't null when instantiated", 23 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 24 | 25 | 26 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUReversingMotorStateActivateReversesMotorDriveTest, FSimplePIETestBase, 27 | "ProjectR.ReversingMotorState Tests.Integration.001: activate reverses the motor drive component passed as parameter ", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/ReversingMotorState/ReversingMotorStateTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | 5 | #if WITH_DEV_AUTOMATION_TESTS 6 | 7 | #include "ReversingMotorStateTestCommands.h" 8 | #include "Jet/MotorStates/ReversingMotorState.h" 9 | #include "../../Utilities/PIESessionUtilities.h" 10 | #include "../../Mocks/JetMOCK.h" 11 | 12 | 13 | //Test preparation commands: 14 | 15 | 16 | bool FSpawningAJetAndActivateReversingMotorState::Update() 17 | { 18 | if (GEditor->IsPlayingSessionInEditor()) 19 | { 20 | PIESessionUtilities sessionUtilities = PIESessionUtilities(); 21 | 22 | 23 | UWorld* testWorld = sessionUtilities.defaultPIEWorld(); 24 | 25 | AJetMOCK* testJet = sessionUtilities.spawnInPIEAnInstanceOf(); 26 | 27 | UReversingMotorState* testState = NewObject(); 28 | 29 | testState->activate(testJet->motorDriveComponent()); 30 | 31 | return true; 32 | } 33 | return false; 34 | } 35 | 36 | 37 | 38 | 39 | 40 | //Test check commands: 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | #endif //WITH_DEV_AUTOMATION_TESTS 50 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/ReversingMotorState/ReversingMotorStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawningAJetAndActivateReversingMotorState); 19 | 20 | 21 | //Test check commands: 22 | 23 | 24 | 25 | 26 | 27 | #endif //WITH_DEV_AUTOMATION_TESTS 28 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RightSteerState/RightSteerStateTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | 21 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FURightSteerStateIsntNullWhenInstantiatedTest, 22 | "ProjectR.RightSteerState Tests.Unit.000: Isn't null when instantiated", 23 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 24 | 25 | 26 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FURightSteerStateActivateTurnsRightSteeringTest, FSimplePIETestBase, 27 | "ProjectR.RightSteerState Tests.Integration.001: activate steers right the steering component passed as parameter", 28 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 29 | 30 | 31 | 32 | 33 | 34 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/RightSteerState/RightSteerStateTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckAJetSteersRight, FVector, previousLocation, FSimplePIETestBase*, test); 22 | 23 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/SingleplayerMenu/SingleplayerMenuTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | 13 | #if WITH_DEV_AUTOMATION_TESTS 14 | 15 | class USingleplayerMenu; 16 | 17 | //Test preparation commands: 18 | 19 | 20 | 21 | 22 | 23 | //Test check commands: 24 | 25 | DEFINE_LATENT_AUTOMATION_COMMAND_FOUR_PARAMETER(FCheckSingleplayerMenuClickMapAndPlayButtonChangesMap, USingleplayerMenu*, singleplayerMenuInstance, bool, menuNeedsInstantiation, bool, hasSelectedMap, FSimplePIETestBase*, test); 26 | 27 | 28 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckSingleplayerMenuClickGoBackRemovesFromViewport, USingleplayerMenu*, singleplayerMenuInstance, bool, isMenuInstanciated, FSimplePIETestBase*, test); 29 | 30 | 31 | DEFINE_LATENT_AUTOMATION_COMMAND_THREE_PARAMETER(FCheckSingleplayerMenuClickGoBackBringsMainMenu, USingleplayerMenu*, singleplayerMenuInstance, bool, isMenuInstanciated, FSimplePIETestBase*, test); 32 | 33 | 34 | 35 | 36 | #endif //WITH_DEV_AUTOMATION_TESTS 37 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/StringHolderButton/StringHolderButtonTest.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | 7 | #include "StringHolderButtonTest.h" 8 | #include "UI/StringHolderButton.h" 9 | #include "Tests/AutomationEditorCommon.h" 10 | #include "../../Commands/CommonPIECommands.h" 11 | #include "StringHolderButtonTestCommands.h" 12 | 13 | 14 | bool FUStringHolderButtonIsntNullWhenInstantiatedTest::RunTest(const FString& Parameters) 15 | { 16 | UStringHolderButton* testButton = NewObject(); 17 | 18 | TestNotNull(TEXT("The string holder button shouldn't be null after instantiating it."), testButton); 19 | 20 | return true; 21 | } 22 | 23 | 24 | bool FUStringHolderButtonStoresStringsTest::RunTest(const FString& Parameters) 25 | { 26 | FString testWorldName = FString("/Game/Tests/TestMaps/VoidWorld-StringHolderContainer"); 27 | establishTestMessageTo(FString("The string holder button should be able to store a FString.")); 28 | establishTickLimitTo(3); 29 | 30 | ADD_LATENT_AUTOMATION_COMMAND(FEditorLoadMap(testWorldName)); 31 | ADD_LATENT_AUTOMATION_COMMAND(FStartPIECommand(true)); 32 | 33 | 34 | 35 | 36 | ADD_LATENT_AUTOMATION_COMMAND(FSpawnGameModeDefaultPawn); 37 | ADD_LATENT_AUTOMATION_COMMAND(FCheckAStringHolderButtonStoresAndRetrievesString(this)); 38 | 39 | ADD_LATENT_AUTOMATION_COMMAND(FEndPlayMapCommand); 40 | return true; 41 | } 42 | 43 | 44 | 45 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/StringHolderButton/StringHolderButtonTest.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | /** 7 | * Each one of this tests should test something of the project class that this test class references to. 8 | * Each project class should have a test class for it. It's something kind of necessary for TDD. 9 | * 10 | * It's nice if the prettyname follows a pattern like: Game.ClassToTest.Unit.TestName 11 | * TestName should express what you expect from a test given a scenario. 12 | * Pay attention to the automation flags because they're needed to run the tests without UI errors. 13 | */ 14 | 15 | #include "Misc/AutomationTest.h" 16 | #include "../../TestBaseClasses/SimplePIETestBase.h" 17 | 18 | #if WITH_DEV_AUTOMATION_TESTS 19 | 20 | IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUStringHolderButtonIsntNullWhenInstantiatedTest, 21 | "ProjectR.StringHolderButton Tests.Unit.000: Isn't null when instantiated", 22 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 23 | 24 | 25 | IMPLEMENT_CUSTOM_SIMPLE_AUTOMATION_TEST(FUStringHolderButtonStoresStringsTest, FSimplePIETestBase, 26 | "ProjectR.StringHolderButton Tests.Unit.001: Stores FSearchResult structs", 27 | EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/StringHolderButton/StringHolderButtonTestCommands.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #if WITH_DEV_AUTOMATION_TESTS 5 | 6 | #include "StringHolderButtonTestCommands.h" 7 | #include "../../Utilities/PIESessionUtilities.h" 8 | #include "UI/StringHolderButton.h" 9 | #include "../../Utilities/BlueprintWidgetContainerPawn.h" 10 | 11 | //Test preparation commands: 12 | 13 | 14 | 15 | 16 | 17 | //Test check commands: 18 | 19 | 20 | bool FCheckAStringHolderButtonStoresAndRetrievesString::Update() 21 | { 22 | if(GEditor->IsPlayingSessionInEditor()) 23 | { 24 | PIESessionUtilities sessionUtilities = PIESessionUtilities(); 25 | ABlueprintWidgetContainerPawn* testContainer = sessionUtilities.retrieveFromPIEAnInstanceOf(); 26 | 27 | if(testContainer) 28 | { 29 | UStringHolderButton* testButton = Cast(testContainer->retrieveWidget()); 30 | FString testString = FString("I'm going into the string holder button."); 31 | 32 | testButton->store(testString); 33 | bool stringsCoincident = testButton->storedString().Contains(testString); 34 | if(stringsCoincident) 35 | { 36 | test->TestTrue(test->conditionMessage(), stringsCoincident); 37 | return true; 38 | } 39 | return test->manageTickCountTowardsLimit(); 40 | } 41 | } 42 | return false; 43 | } 44 | 45 | 46 | 47 | 48 | #endif //WITH_DEV_AUTOMATION_TESTS 49 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/StringHolderButton/StringHolderButtonTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckAStringHolderButtonStoresAndRetrievesString, FSimplePIETestBase*, test); 22 | 23 | 24 | 25 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/StringScrollBox/StringScrollBoxTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | 19 | //Test check commands: 20 | 21 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckAStringScrollBoxPopulateBoxNumberOfChilds, FSimplePIETestBase*, test); 22 | 23 | 24 | class UStringHolderButton; 25 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckAStringScrollBoxChildClicked, UStringHolderButton*, aButtonHolder, FSimplePIETestBase*, test); 26 | 27 | 28 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckAStringScrollBoxKeepsArraySize, UStringHolderButton*, aButtonHolder, FSimplePIETestBase*, test); 29 | 30 | 31 | 32 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Tests/TrackManager/TrackManagerTestCommands.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | /** 6 | * This file contains the latent commands necessary for the tests. 7 | */ 8 | 9 | #include "Misc/AutomationTest.h" 10 | #include "../../TestBaseClasses/SimplePIETestBase.h" 11 | 12 | #if WITH_DEV_AUTOMATION_TESTS 13 | 14 | 15 | //Test preparation commands: 16 | 17 | 18 | DEFINE_LATENT_AUTOMATION_COMMAND(FSpawningARotatedTrackGeneratorAndJetCloseToIt); 19 | 20 | 21 | 22 | 23 | 24 | //Test check commands: 25 | 26 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckATrackManagerTrackGenerators, FSimplePIETestBase*, test); 27 | 28 | 29 | DEFINE_LATENT_AUTOMATION_COMMAND_ONE_PARAMETER(FCheckATrackManagerStoresJetsWhenOverlap, FSimplePIETestBase*, test); 30 | 31 | 32 | DEFINE_LATENT_AUTOMATION_COMMAND_TWO_PARAMETER(FCheckATrackManagerAttractsJets, float, aPreviousDistance, FSimplePIETestBase*, test); 33 | 34 | 35 | 36 | 37 | #endif //WITH_DEV_AUTOMATION_TESTS -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/BlueprintWidgetContainerPawn.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "BlueprintWidgetContainerPawn.h" 5 | #include "Blueprint/UserWidget.h" 6 | 7 | // Sets default values 8 | ABlueprintWidgetContainerPawn::ABlueprintWidgetContainerPawn() 9 | { 10 | // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. 11 | PrimaryActorTick.bCanEverTick = false; 12 | widget = nullptr; 13 | } 14 | 15 | // Called when the game starts or when spawned 16 | void ABlueprintWidgetContainerPawn::BeginPlay() 17 | { 18 | Super::BeginPlay(); 19 | if(widgetClass) 20 | { 21 | widget = UUserWidget::CreateWidgetInstance(*GetWorld(), widgetClass, FName("Widget instance")); 22 | } 23 | } 24 | 25 | UUserWidget* ABlueprintWidgetContainerPawn::retrieveWidget() 26 | { 27 | return widget; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/BlueprintWidgetContainerPawn.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Pawn.h" 7 | #include "BlueprintWidgetContainerPawn.generated.h" 8 | 9 | UCLASS() 10 | class TESTINGMODULE_API ABlueprintWidgetContainerPawn : public APawn 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | // Sets default values for this pawn's properties 16 | ABlueprintWidgetContainerPawn(); 17 | 18 | protected: 19 | // Called when the game starts or when spawned 20 | virtual void BeginPlay() override; 21 | 22 | UPROPERTY(EditDefaultsOnly, Category= "Widget") 23 | TSubclassOf widgetClass; 24 | 25 | UPROPERTY() 26 | UUserWidget* widget; 27 | 28 | public: 29 | UUserWidget* retrieveWidget(); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/ObjectContainerActor.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "ObjectContainerActor.h" 5 | 6 | // Sets default values 7 | AObjectContainerActor::AObjectContainerActor() 8 | { 9 | PrimaryActorTick.bCanEverTick = false; 10 | storedObject = nullptr; 11 | } 12 | 13 | UObject* AObjectContainerActor::retrieveStoredObject() 14 | { 15 | return storedObject; 16 | } 17 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/ObjectContainerActor.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include "ObjectContainerActor.generated.h" 8 | 9 | UCLASS() 10 | class TESTINGMODULE_API AObjectContainerActor : public AActor 11 | { 12 | GENERATED_BODY() 13 | 14 | protected: 15 | UPROPERTY() 16 | UObject* storedObject; 17 | 18 | public: 19 | // Sets default values for this actor's properties 20 | AObjectContainerActor(); 21 | 22 | template 23 | void storeObjectOfType(); 24 | 25 | UObject* retrieveStoredObject(); 26 | }; 27 | 28 | template 29 | void AObjectContainerActor::storeObjectOfType() 30 | { 31 | storedObject = NewObject(this, aDerivedUObjectClass::StaticClass()->GetFName()); 32 | } 33 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/floorMeshActor.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "FloorMeshActor.h" 5 | 6 | 7 | AFloorMeshActor::AFloorMeshActor() 8 | { 9 | PrimaryActorTick.bCanEverTick = false; 10 | 11 | meshComponent = CreateDefaultSubobject(TEXT("Mesh Component")); 12 | RootComponent = meshComponent; 13 | 14 | meshComponent->SetSimulatePhysics(false); 15 | meshComponent->SetEnableGravity(false); 16 | meshComponent->SetCanEverAffectNavigation(false); 17 | 18 | UStaticMesh* Mesh = Cast(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("/Engine/EditorMeshes/PhAT_FloorBox"))); 19 | meshComponent->SetStaticMesh(Mesh); 20 | 21 | meshComponent->SetWorldScale3D(FVector(5,5,1)); 22 | } 23 | 24 | void AFloorMeshActor::BeginPlay() 25 | { 26 | Super::BeginPlay(); 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/TestingModule/Testing/Utilities/floorMeshActor.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include "FloorMeshActor.generated.h" 8 | 9 | UCLASS() 10 | class TESTINGMODULE_API AFloorMeshActor : public AActor 11 | { 12 | GENERATED_BODY() 13 | 14 | private: 15 | UPROPERTY(VisibleAnywhere, Category = "Components") 16 | UStaticMeshComponent* meshComponent; 17 | 18 | public: 19 | // Sets default values for this actor's properties 20 | AFloorMeshActor(); 21 | 22 | protected: 23 | // Called when the game starts or when spawned 24 | virtual void BeginPlay() override; 25 | 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /Source/TestingModule/TestingModule.Build.cs: -------------------------------------------------------------------------------- 1 | using UnrealBuildTool; 2 | 3 | public class TestingModule : ModuleRules 4 | { 5 | public TestingModule(ReadOnlyTargetRules Target) : base(Target) 6 | { 7 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 8 | PublicDependencyModuleNames.AddRange(new string[] { 9 | "Core", 10 | "CoreUObject", 11 | "Engine", 12 | "InputCore", 13 | "UnrealEd", 14 | "UMG", 15 | "OnlineSubsystem", 16 | "OnlineSubsystemUtils", 17 | "ProjectR", 18 | "Slate", 19 | "SlateCore" 20 | }); 21 | 22 | DynamicallyLoadedModuleNames.Add("OnlineSubsystemNull"); 23 | } 24 | } -------------------------------------------------------------------------------- /Source/TestingModule/TestingModule.cpp: -------------------------------------------------------------------------------- 1 | #include "TestingModule.h" 2 | #include "Modules/ModuleManager.h" 3 | 4 | IMPLEMENT_MODULE(FTestingModule, TestingModule); 5 | 6 | void FTestingModule::StartupModule() 7 | { 8 | // Put your module initialization code here 9 | } 10 | 11 | void FTestingModule::ShutdownModule() 12 | { 13 | // Put your module termination code here 14 | } -------------------------------------------------------------------------------- /Source/TestingModule/TestingModule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Modules/ModuleInterface.h" 5 | 6 | class FTestingModule : public IModuleInterface 7 | { 8 | virtual void StartupModule() override; 9 | virtual void ShutdownModule() override; 10 | }; -------------------------------------------------------------------------------- /TestRunner.bat: -------------------------------------------------------------------------------- 1 | set ue4Location=%~1 2 | set workspace=%~2 3 | set projectFilename=%~3 4 | set testSuiteToRun=%~4 5 | set testReportFolder=%~5 6 | set testsLogName=%~6 7 | 8 | "%ue4Location%\Engine\Binaries\Win64\UE4Editor-cmd.exe" "%workspace%\%projectFilename%" -nosplash -Unattended -nopause -nosound -NullRHI -nocontentbrowser -ExecCmds="Automation RunTests %testSuiteToRun%;quit" -TestExit="Automation Test Queue Empty" -ReportOutputPath="%workspace%\%testReportFolder%" -Log=%testsLogName% 9 | -------------------------------------------------------------------------------- /TestRunnerAndCodeCoverage.bat: -------------------------------------------------------------------------------- 1 | set ue4Location=%~1 2 | set workspace=%~2 3 | set projectFilename=%~3 4 | set testSuiteToRun=%~4 5 | set testReportFolder=%~5 6 | set testsLogName=%~6 7 | set codeCoverageFile=%~7 8 | 9 | set testRunnerCommand="%ue4Location%\Engine\Binaries\Win64\UE4Editor-cmd.exe" "%workspace%\%projectFilename%" -nosplash -Unattended -nopause -nosound -NullRHI -nocontentbrowser -ExecCmds="Automation RunTests %testSuiteToRun%;quit" -TestExit="Automation Test Queue Empty" -ReportOutputPath="%workspace%\%testReportFolder%" -Log=%testsLogName% 10 | 11 | "C:\Program Files\OpenCppCoverage\opencppcoverage.exe" --sources=%workspace%\Source --modules %workspace% --excluded_sources=\Tests --export_type=cobertura:%codeCoverageFile% -- %testRunnerCommand% --------------------------------------------------------------------------------