Beispiel #1
0
    protected void SetUp()
    {
        RenderProfileManifest.i.Initialize();

        sceneHandler = Substitute.For <ISceneHandler>();

        var allLoadedParcelCoords = new HashSet <Vector2Int>();

        allLoadedParcelCoords.Add(new Vector2Int(0, 0));
        allLoadedParcelCoords.Add(new Vector2Int(-1, 0));
        allLoadedParcelCoords.Add(new Vector2Int(-1, 1));

        sceneHandler.GetAllLoadedScenesCoords().Returns(allLoadedParcelCoords);

        var animationHandler = Substitute.For <IBlockerAnimationHandler>();

        //NOTE(Brian): Call OnFinish() when blockerAnimationHandler.FadeOut is called.
        animationHandler.FadeOut(Arg.Any <GameObject>(), Arg.Invoke());

        var newBlockerInstanceHandler = new BlockerInstanceHandler();

        newBlockerInstanceHandler.Initialize(animationHandler);

        blockerInstanceHandler = newBlockerInstanceHandler;
        blockersParent         = new GameObject();
        blockerInstanceHandler.SetParent(blockersParent.transform);

        blockerController = new WorldBlockersController();
        blockerController.Initialize(sceneHandler, blockerInstanceHandler);
    }
    public void SetupBlockersOnlyWhenEnabled()
    {
        // Arrange
        blockerInstanceHandler = Substitute.For <IBlockerInstanceHandler>();
        blockerInstanceHandler.GetBlockers().Returns(new Dictionary <Vector2Int, PoolableObject>());
        blockerController = new WorldBlockersController(sceneHandler, blockerInstanceHandler, new DCLCharacterPosition());

        // Act-assert #1: first blockers added should be shown
        blockerController.SetupWorldBlockers();
        blockerInstanceHandler.ReceivedWithAnyArgs().ShowBlocker(default);
Beispiel #3
0
        public void Initialize(IMessageProcessHandler messageHandler, ISceneHandler sceneHandler)
        {
            if (initialized)
            {
                return;
            }

            messagingControllersManager.Initialize(messageHandler);
            pointerEventsController.Initialize();
            memoryManager.Initialize();
            worldBlockersController = WorldBlockersController.CreateWithDefaultDependencies(sceneHandler, DCLCharacterController.i.characterPosition);

            initialized = true;
        }
Beispiel #4
0
 protected void SetUp()
 {
     blockerHandler    = new FakeBlockerHandler();
     blockersParent    = new GameObject();
     blockerController = new WorldBlockersController(new FakeSceneHandler(), blockerHandler, new DCLCharacterPosition());
 }