< Summary

Class:HUDFactory
Assembly:HUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/HUDFactory.cs
Covered lines:51
Uncovered lines:0
Coverable lines:51
Total lines:114
Line coverage:100% (51 of 51)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CreateHUD(...)0%26260100%
Dispose()0%110100%
Initialize()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/HUDFactory.cs

#LineLine coverage
 1using System;
 2using DCL;
 3using DCL.HelpAndSupportHUD;
 4using DCL.Huds.QuestsPanel;
 5using DCL.Huds.QuestsTracker;
 6using DCL.SettingsPanelHUD;
 7using LoadingHUD;
 8using SignupHUD;
 9using UnityEngine;
 10
 11public class HUDFactory : IHUDFactory
 12{
 13    public virtual IHUD CreateHUD(HUDElementID hudElementId)
 14    {
 2515        IHUD hudElement = null;
 16        switch (hudElementId)
 17        {
 18            case HUDElementID.NONE:
 19                break;
 20            case HUDElementID.MINIMAP:
 121                hudElement = new MinimapHUDController();
 122                break;
 23            case HUDElementID.PROFILE_HUD:
 124                hudElement = new ProfileHUDController(new UserProfileWebInterfaceBridge());
 125                break;
 26            case HUDElementID.NOTIFICATION:
 127                hudElement = new NotificationHUDController();
 128                break;
 29            case HUDElementID.AVATAR_EDITOR:
 130                hudElement = new AvatarEditorHUDController();
 131                break;
 32            case HUDElementID.SETTINGS_PANEL:
 133                hudElement = new SettingsPanelHUDController();
 134                break;
 35            case HUDElementID.EXPRESSIONS:
 36            case HUDElementID.EMOTES:
 237                hudElement = new EmotesHUDController();
 238                break;
 39            case HUDElementID.PLAYER_INFO_CARD:
 140                hudElement = new PlayerInfoCardHUDController(FriendsController.i,
 41                    Resources.Load<StringVariable>("CurrentPlayerInfoCardId"),
 42                    new UserProfileWebInterfaceBridge(),
 43                    new WearablesCatalogControllerBridge(),
 44                    ProfanityFilterSharedInstances.regexFilter,
 45                    DataStore.i);
 146                break;
 47            case HUDElementID.AIRDROPPING:
 148                hudElement = new AirdroppingHUDController();
 149                break;
 50            case HUDElementID.TERMS_OF_SERVICE:
 151                hudElement = new TermsOfServiceHUDController();
 152                break;
 53            case HUDElementID.WORLD_CHAT_WINDOW:
 154                hudElement = new WorldChatWindowHUDController();
 155                break;
 56            case HUDElementID.FRIENDS:
 157                hudElement = new FriendsHUDController();
 158                break;
 59            case HUDElementID.PRIVATE_CHAT_WINDOW:
 160                hudElement = new PrivateChatWindowHUDController();
 161                break;
 62            case HUDElementID.TASKBAR:
 163                hudElement = new TaskbarHUDController();
 164                break;
 65            case HUDElementID.OPEN_EXTERNAL_URL_PROMPT:
 166                hudElement = new ExternalUrlPromptHUDController();
 167                break;
 68            case HUDElementID.NFT_INFO_DIALOG:
 169                hudElement = new NFTPromptHUDController();
 170                break;
 71            case HUDElementID.TELEPORT_DIALOG:
 172                hudElement = new TeleportPromptHUDController();
 173                break;
 74            case HUDElementID.CONTROLS_HUD:
 175                hudElement = new ControlsHUDController();
 176                break;
 77            case HUDElementID.HELP_AND_SUPPORT_HUD:
 178                hudElement = new HelpAndSupportHUDController();
 179                break;
 80            case HUDElementID.USERS_AROUND_LIST_HUD:
 181                hudElement = new UsersAroundListHUDController();
 182                break;
 83            case HUDElementID.GRAPHIC_CARD_WARNING:
 184                hudElement = new GraphicCardWarningHUDController();
 185                break;
 86            case HUDElementID.BUILDER_IN_WORLD_MAIN:
 87                break;
 88            case HUDElementID.QUESTS_PANEL:
 189                hudElement = new QuestsPanelHUDController();
 190                break;
 91            case HUDElementID.QUESTS_TRACKER:
 192                hudElement = new QuestsTrackerHUDController();
 193                break;
 94            case HUDElementID.SIGNUP:
 195                hudElement = new SignupHUDController();
 196                break;
 97            case HUDElementID.BUILDER_PROJECTS_PANEL:
 98                break;
 99            case HUDElementID.LOADING:
 1100                hudElement = new LoadingHUDController();
 101                break;
 102        }
 103
 25104        return hudElement;
 105    }
 106
 107    public void Dispose()
 108    {
 629109    }
 110
 111    public void Initialize()
 112    {
 629113    }
 114}