Ejemplo n.º 1
0
        /// <summary>
        /// 로컬사인배너 연결 정보 저장하기
        /// </summary>
        /// <param name="Param"></param>
        /// <returns></returns>
        public JsonResult adBeaconSave(T_AD_BEACON Param)
        {
            RTN_SAVE_DATA rtn = new BeaconService().AdBeaconSave(Param);

            return(new JsonResult {
                Data = rtn
            });
        }
Ejemplo n.º 2
0
 public HomeViewModel()
 {
     _service = RootWorkItem.Services.Get <BeaconService>();
     if (_service == null)
     {
         _service = RootWorkItem.Services.AddNew <BeaconService>();
         _service.Beacons.CollectionChanged += Beacons_CollectionChanged;
     }
 }
Ejemplo n.º 3
0
 private void subCategory_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     if (subCategory.Items.Count > 0)
     {
         Helpers.Settings.SubCategorySettings = subCategory.SelectedItem.ToString();
         BeaconService.Start();
         this.Navigation.PushModalAsync(new Navigator());
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 로컬사이니지 배너 저장하기
        /// </summary>
        /// <param name="Param"></param>
        /// <returns></returns>
        public JsonResult AdBeaconSave(T_AD_BEACON Param)
        {
            Param.INSERT_CODE = (int)SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            RTN_SAVE_DATA rtn = new BeaconService().AdBeaconSave(Param);

            return(new JsonResult {
                Data = rtn
            });
        }
 private void ScareCharactersInRange(GameEntity beaconEntity)
 {
     foreach (GameEntity characterEntity
              in BeaconService.GetMobileCharacterEntitiesInRange(beaconEntity))
     {
         characterEntity.isScared = true;
         characterEntity.ReplaceMoveTarget(
             GetScaringDestinationPoint(beaconEntity, characterEntity));
     }
 }
 private void Init()
 {
     _service = RootWorkItem.Services.Get <BeaconService>();
     if (_service == null)
     {
         Debug.WriteLine("Creating beacon discovery service...");
         _service = RootWorkItem.Services.AddNew <BeaconService>();
         //if (_service.Beacons != null) _service.Beacons.CollectionChanged += Beacons_CollectionChanged;
     }
 }
Ejemplo n.º 7
0
        protected override void OnStart()
        {
            BeaconService.Entered += OnBeaconServiceEnter;
            BeaconService.Left    += OnBeaconServiceLeft;

            var devices = App.Settings.Beacons.Items.Where(b => b.Device != null).Select(b => b.Device);

            BeaconService.Start(devices);

            NotificationService.Start();
        }
 private void SummonCharactersInRange(GameEntity beaconEntity)
 {
     foreach (GameEntity characterEntity
              in BeaconService.GetMobileCharacterEntitiesInRange(beaconEntity))
     {
         if (!beaconEntity.BelongsToFactionOf(characterEntity))
         {
             continue;
         }
         characterEntity.ReplaceMoveTarget(beaconEntity.position);
     }
 }
Ejemplo n.º 9
0
 private void StartBeaconService()
 {
     _service = RootWorkItem.Services.Get <BeaconService>();
     if (_service == null)
     {
         _service = RootWorkItem.Services.AddNew <BeaconService>();
         if (_service.Beacons != null)
         {
             _service.Beacons.CollectionChanged += Beacons_CollectionChanged;
         }
     }
 }
Ejemplo n.º 10
0
 private void StartBeaconService()
 {
     System.Console.WriteLine("STH STH STH");
     _service = RootWorkItem.Services.Get <BeaconService>();
     if (_service == null)
     {
         _service = RootWorkItem.Services.AddNew <BeaconService>();
         if (_service.Beacons != null)
         {
             _service.Beacons.CollectionChanged += Beacons_CollectionChanged;
         }
     }
 }
Ejemplo n.º 11
0
        public void OnBeaconServiceConnect()
        {
            BeaconService   beaconService   = Xamarin.Forms.DependencyService.Get <BeaconService>();
            UserDataService userDataService = new UserDataService();

            beaconService.StartBeacon();

            if (userDataService.IsExistUserData())
            {
                UserDataModel userDataModel = userDataService.Get();
                beaconService.StartAdvertising(userDataModel);
            }
        }
Ejemplo n.º 12
0
        public async void GetById_SendsQueryWithTheCorrectUserId_Verify()
        {
            // Arrange
            const int userId = 1;

            this.mockMediator = new Mock <IMediator>();
            var beaconService = new BeaconService(this.mockMediator.Object);

            // Act
            await beaconService.GetById(userId);

            // Assert
            this.mockMediator.Verify(x => x.SendAsync(It.Is <BeaconQuery>(y => y.Id == userId)), Times.Once);
        }
 protected override void Execute(List <GameEntity> requestEntities)
 {
     foreach (var requestEntity in requestEntities)
     {
         BeaconAction newAction = requestEntity.switchBeaconActionRequest.NewBeaconAction;
         gameContext.gameStateEntity.ReplaceBeaconAction(newAction);
         gameContext.gameStateEntity.ReplaceBeaconRange(
             BeaconService.GetDefaultRangeForAction(newAction)
             );
         gameContext.gameStateEntity.ReplaceBeaconCost(
             BeaconService.GetDefaultCostForAction(newAction)
             );
     }
 }
Ejemplo n.º 14
0
        public void OnBeaconServiceConnect()
        {
            BeaconService   beaconService   = DependencyService.Get <BeaconService>();
            UserDataService userDataService = new UserDataService();


            Task.Run(() =>
            {
                beaconService.StartBeacon();
                if (userDataService.IsExistUserData)
                {
                    UserDataModel userDataModel = userDataService.Get();
                    beaconService.StartAdvertising(userDataModel);
                }
            });
        }
Ejemplo n.º 15
0
        public UserTests()
        {
            // create database
            DatabaseContext dbContext = CreateEmptyDatabase();

            this.azureService = new AzureServiceMock();

            this.userRepository = new UserRepository(dbContext);
            this.userService    = new UserService(this.userRepository);

            this.beaconRepository = new BeaconRepository(dbContext);
            this.beaconService    = new BeaconService(this.beaconRepository);

            this.eventRepository = new EventRepository(dbContext);
            this.eventService    = new EventService(this.eventRepository, this.userRepository, this.azureService);

            // create user controller
            this.userController = new UserController(this.userService, this.beaconService, this.eventService);
        }
Ejemplo n.º 16
0
        public async void GetById_WithProperUserId_ReturnsBeaconViewModel()
        {
            // Arrange
            const int userId = 1;

            var beaconViewModel = new BeaconViewModel
            {
                Id = 2123
            };

            BeaconService beaconService = beaconServiceBuilder
                                          .WithBeaconViewModel(beaconViewModel)
                                          .Build();

            // Act
            BeaconViewModel beaconViewModelResult = await beaconService.GetById(userId);

            // Assert
            beaconViewModelResult.Should().NotBeNull();
            beaconViewModelResult.Id.Should().Be(beaconViewModel.Id);
        }
Ejemplo n.º 17
0
 public BeaconController(BeaconService beaconService, LocationService locationService)
 {
     this.beaconService   = beaconService;
     this.locationService = locationService;
 }
 public UserController(UserService userService, BeaconService beaconService, EventService eventService)
 {
     this.userService   = userService;
     this.beaconService = beaconService;
     this.eventService  = eventService;
 }
Ejemplo n.º 19
0
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            BeaconService beaconService = new BeaconService();

            containerRegistry.RegisterSingleton <IBeaconService, BeaconService>();
        }