Пример #1
0
        public MouseControlService(
            Transform player,
            MovementEventRepository movementEventRepository,
            DirectionHelper directionHelper,
            PickupEventRepository pickupEventRepository,
            InteractWithNpcEventRepository interactWithNpcEventRepository,
            NewTextEventRepository newTextEventRepository,
            FinishDialogueEventRepository finishDialogueEventRepository,
            InteractWithSceneTransferEventRepository interactWithSceneTransferEventRepository,
            StartDialogueEventRepository startDialogueEventRepository,
            PlayerConfig config)
        {
            this.movementEventRepository = movementEventRepository ?? throw new ArgumentNullException(nameof(movementEventRepository));
            this.directionHelper         = directionHelper ?? throw new ArgumentNullException(nameof(directionHelper));
            this.pickupEventRepository   = pickupEventRepository ?? throw new ArgumentNullException(nameof(pickupEventRepository));
            this.player = player;
            this.newTextEventRepository                   = newTextEventRepository ?? throw new ArgumentNullException(nameof(newTextEventRepository));
            this.finishDialogueEventRepository            = finishDialogueEventRepository ?? throw new ArgumentNullException(nameof(finishDialogueEventRepository));
            this.interactWithSceneTransferEventRepository = interactWithSceneTransferEventRepository ?? throw new ArgumentNullException(nameof(interactWithSceneTransferEventRepository));
            this.startDialogueEventRepository             = startDialogueEventRepository;
            this.interactWithNpcEventRepository           = interactWithNpcEventRepository ?? throw new ArgumentNullException(nameof(interactWithNpcEventRepository));
            this.config = config ?? throw new ArgumentNullException(nameof(config));

            previousPointClicked  = new Vector3(0, 0, 0);
            previousClickDateTime = DateTime.UtcNow;
        }
 public NpcInteractionService(
     PlayerConfig config,
     MovementEventRepository movementEventRepository,
     InteractWithNpcEventRepository interactWithNpcEventRepository,
     StartDialogueEventRepository startDialogueEventRepository,
     Transform player)
 {
     this.config = config ?? throw new ArgumentNullException(nameof(config));
     this.movementEventRepository        = movementEventRepository ?? throw new ArgumentNullException(nameof(movementEventRepository));
     this.interactWithNpcEventRepository = interactWithNpcEventRepository ?? throw new ArgumentNullException(nameof(interactWithNpcEventRepository));
     this.startDialogueEventRepository   = startDialogueEventRepository ?? throw new ArgumentNullException(nameof(startDialogueEventRepository));
     this.player = player ?? throw new ArgumentNullException(nameof(player));
 }