Ejemplo n.º 1
0
    public void UpdatePositionAndSaveConnections(PiecePrefab piece, IBoardService boardService)
    {
        var uniqueRootPositions = new List <IntVector2>();

        foreach (var connectedPiece in piece.connectedPieces)
        {
            var rootPositionForPiece = _gameState.rootPositionsForEachPiece[connectedPiece.BoardPosition];

            if (!uniqueRootPositions.Contains(rootPositionForPiece))
            {
                uniqueRootPositions.Add(rootPositionForPiece);
            }
        }

        for (int i = 1; i < uniqueRootPositions.Count; ++i)
        {
            MergeRoots(uniqueRootPositions[0], uniqueRootPositions[i]);
        }

        var rootPosition = _gameState.rootPositionsForEachPiece[piece.BoardPosition];

        _gameState.rootsByBoardPosition[rootPosition].worldPosition = boardService.GetWorldPositionForPiece(rootPosition);

        CheckIfWon();
    }
 public BoardPrinterService(IBoardService boardService,
                            IShipCollectionService shipCollectionService, IOutputLoggerAdapter outputLoggerAdapter)
 {
     _boardService          = boardService;
     _shipCollectionService = shipCollectionService;
     _outputLoggerAdapter   = outputLoggerAdapter;
 }
Ejemplo n.º 3
0
 public BoardController(
     IBoardService boardService,
     IMapper mapper)
 {
     _boardService = boardService;
     _mapper       = mapper;
 }
Ejemplo n.º 4
0
        public List <string> AvailableMoves(string source, IBoardService boardService)
        {
            List <string> result    = new List <string>();
            List <int[]>  resultInt = new List <int[]>();

            int[] sourceInt = boardService.ConvertStringToColRow(source);

            resultInt.Add((new int[] { sourceInt[0] + 2, sourceInt[1] + 1 }));
            resultInt.Add((new int[] { sourceInt[0] + 2, sourceInt[1] - 1 }));
            resultInt.Add((new int[] { sourceInt[0] - 2, sourceInt[1] + 1 }));
            resultInt.Add((new int[] { sourceInt[0] - 2, sourceInt[1] - 1 }));
            resultInt.Add((new int[] { sourceInt[0] + 1, sourceInt[1] + 2 }));
            resultInt.Add((new int[] { sourceInt[0] + 1, sourceInt[1] - 2 }));
            resultInt.Add((new int[] { sourceInt[0] - 1, sourceInt[1] + 2 }));
            resultInt.Add((new int[] { sourceInt[0] - 1, sourceInt[1] - 2 }));

            foreach (int[] r in resultInt)
            {
                if (boardService.IsInsideBoard(r))
                {
                    result.Add(boardService.ConvertColRowToString(r));
                }
            }

            return(result);
        }
Ejemplo n.º 5
0
 public PostsController(IBoardService boardService, IUserService userService, IPostService postService, IMapper mapper)
 {
     _boardService = boardService;
     _userService  = userService;
     _postService  = postService;
     _mapper       = mapper;
 }
Ejemplo n.º 6
0
 public BoardController(IBoardService boardService, ITileTypeService tileTypeService, IPutTileService putTileService, IMapper mapper)
 {
     _boardService    = boardService;
     _tileTypeService = tileTypeService;
     _putTileService  = putTileService;
     _mapper          = mapper;
 }
Ejemplo n.º 7
0
 public GameServiceTest()
 {
     _gameService  = ServiceLocatorContainer.CurrentLocator.Resolve <IGameService>();
     _boardService = ServiceLocatorContainer.CurrentLocator.Resolve <IBoardService>();
     _boardService.ClearBoardFromCache();
     _boardService.CreateBoardAsync();
 }
Ejemplo n.º 8
0
 public BattleshipGameService(IShipCollectionService shipCollectionService, IBoardService boardService,
                              IBoardPrinterService boardServicePrinter)
 {
     _shipCollectionService = shipCollectionService;
     _boardService          = boardService;
     _boardServicePrinter   = boardServicePrinter;
 }
Ejemplo n.º 9
0
 public BoardViewModel(
     IBoardService boardService,
     INavigationService navigationService)
 {
     _boardService      = boardService;
     _navigationService = navigationService;
 }
Ejemplo n.º 10
0
        protected void SetUp()
        {
            var bootstrap = new Bootstrap();

            _serviceProvider = bootstrap.RegisterServices(_serviceProvider);
            _boardService    = _serviceProvider.GetService <IBoardService>();
        }
 public void InitializeServicesWithAuthenticationType(AuthenticationType type)
 {
     if (type == AuthenticationType.Basic)
     {
         this._userService       = new UserService(AuthenticationType.Basic);
         this._issueService      = new IssueService(AuthenticationType.Basic);
         this._transitionService = new TransitionService(AuthenticationType.Basic);
         this._priorityService   = new PriorityService(AuthenticationType.Basic);
         this._attachmentService = new AttachmentService(AuthenticationType.Basic);
         this._boardService      = new BoardService(AuthenticationType.Basic);
         this._sprintService     = new SprintService(AuthenticationType.Basic);
         this._projectService    = new ProjectService(AuthenticationType.Basic);
     }
     else if (type == AuthenticationType.OAuth)
     {
         this._userService       = new UserService(AuthenticationType.OAuth);
         this._issueService      = new IssueService(AuthenticationType.OAuth);
         this._transitionService = new TransitionService(AuthenticationType.OAuth);
         this._priorityService   = new PriorityService(AuthenticationType.OAuth);
         this._attachmentService = new AttachmentService(AuthenticationType.OAuth);
         this._boardService      = new BoardService(AuthenticationType.OAuth);
         this._sprintService     = new SprintService(AuthenticationType.OAuth);
         this._projectService    = new ProjectService(AuthenticationType.OAuth);
     }
 }
Ejemplo n.º 12
0
 public ApiController(IBoardService boardService, IThreadService threadService, IPostService postService /*, IMapper mapper*/)
 {
     this._boardService  = boardService;
     this._threadService = threadService;
     this._postService   = postService;
     //this._mapper = mapper;
 }
Ejemplo n.º 13
0
 public MetaRequestAttribute(string boardIdParameter)
 {
     // I can't figure out how to do property injection on an Attribute using Munq.
     // I have to resort to this... =(
     _boardService = DependencyResolver.Current.GetService<IBoardService>();
     _boardIdParameter = boardIdParameter;
 }
Ejemplo n.º 14
0
 public NotationViewModel(IBoardService analysisBoardService)
 {
     this.analysisBoardService = analysisBoardService;
     Messenger.Default.Register <GenericMessage <MoveData> >(this, NotificationMessages.MoveExecuted, OnMoveExecutedMessage);
     Messenger.Default.Register <GenericMessage <MoveData> >(this, NotificationMessages.GoBackExecuted, OnMoveExecutedMessage);
     Messenger.Default.Register <GenericMessage <MoveData> >(this, NotificationMessages.GoForwardExecuted, OnMoveExecutedMessage);
 }
Ejemplo n.º 15
0
        public BoardModel(IBoardService boardService)
        {
            var initialBoard = boardService.CreateInitialBoard();

            Points = initialBoard.Item1;
            Mills  = initialBoard.Item2;
        }
Ejemplo n.º 16
0
        public void GetRubrics_Should_Return_AllRubrics()
        {
            // arrange
            var fixture = new Fixture();
            List <DAL.Model.Rubric> rubrics = new List <DAL.Model.Rubric>()
            {
                new DAL.Model.Rubric {
                    RubricName = "first"
                },
                new DAL.Model.Rubric {
                    RubricName = "second"
                },
                new DAL.Model.Rubric {
                    RubricName = "third"
                }
            };

            unitOfWork = Substitute.For <UnitOfWork>(new object[] { null });
            unitOfWork.GetGenericRepository <RubricRepository, DAL.Model.Rubric>()
            .Returns(Substitute.For <IRepository <DAL.Model.Rubric> >()
                     );

            var userRepo = unitOfWork.GetRepository <IUserRepository>();
            var genericUserRepository = unitOfWork.GetGenericRepository <RubricRepository, DAL.Model.Rubric>();

            genericUserRepository.Get().Returns(rubrics);

            boardService = new BoardService(unitOfWork);
            // act
            var rubricsResult = boardService.GetRubrics();

            // assert
            Assert.IsTrue(rubricsResult.Count == rubrics.Count);
        }
Ejemplo n.º 17
0
        public BoardPageViewModel(INavigationService navigationService, IBoardService boardService)
        {
            this.navigationService = navigationService;
            this.boardService      = boardService;

            NotationViewModel = new NotationViewModel(boardService);
        }
Ejemplo n.º 18
0
        public ViewModelLoader() 
        {
            unityContainer = new UnityContainer();

            RegisterTypes();

            string kinectSetting = ConfigurationManager.AppSettings["KinectService"].ToString();
            string sourceSetting = ConfigurationManager.AppSettings["SourceService"].ToString();
            string boardSetting = ConfigurationManager.AppSettings["BoardService"].ToString();
            string helpSetting = ConfigurationManager.AppSettings["HelpService"].ToString();


            kinectService = unityContainer.Resolve<IKinectService>(kinectSetting);
            sourceService = unityContainer.Resolve<ISourceService>(sourceSetting);
            boardService = unityContainer.Resolve<IBoardService>(boardSetting);
            helpService = unityContainer.Resolve<IHelpService>(helpSetting);

            var prop = DesignerProperties.IsInDesignModeProperty; 
            var isInDesignMode = (bool)DependencyPropertyDescriptor
                .FromProperty(prop, typeof(FrameworkElement))
                .Metadata.DefaultValue; 
            
            if (!isInDesignMode) 
            { 
                kinectService.Initialize();
                sourceService.Initialize();
                helpService.Initialize();
            } 
        }
Ejemplo n.º 19
0
 public MetaRequestAttribute(string boardIdParameter)
 {
     // I can't figure out how to do property injection on an Attribute using Munq.
     // I have to resort to this... =(
     _boardService     = DependencyResolver.Current.GetService <IBoardService>();
     _boardIdParameter = boardIdParameter;
 }
Ejemplo n.º 20
0
 public CommonController(
     ITransactionService transactionService,
     LocalizationSettings localizationSettings,
     ICustomerPlanService customerPlanService,
     IPlanService planService,
     ICommonServices services,
     IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings, TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext, IStoreContext storeContext,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     IBoardService boardService,
     ICountryService countryService,
     IAdCampaignService adCampaignService)
 {
     _planService             = planService;
     _customerPlanService     = customerPlanService;
     _localizationSettings    = localizationSettings;
     _transactionService      = transactionService;
     _services                = services;
     _authenticationService   = authenticationService;
     _dateTimeHelper          = dateTimeHelper;
     _dateTimeSettings        = dateTimeSettings;
     _localizationService     = localizationService;
     _workContext             = workContext;
     _storeContext            = storeContext;
     _customerService         = customerService;
     _genericAttributeService = genericAttributeService;
     _countryService          = countryService;
     _adCampaignService       = adCampaignService;
 }
Ejemplo n.º 21
0
        public ShipControllerTests()
        {
            _shipService  = Substitute.For <IShipService>();
            _boardService = Substitute.For <IBoardService>();

            _shipController = new ShipController(_shipService, _boardService);
        }
        void Connect()
        {
            var group = ServiceModelSectionGroup.GetSectionGroup(
                ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None));

            //create duplex channel factory
            var serviceFactory = new DuplexChannelFactory <IBoardService>(
                this, group.Client.Endpoints[0].Name);

            //create a communication channel and register for its events
            this.serviceProxy = serviceFactory.CreateChannel();

            var channel = (IClientChannel)this.serviceProxy;

            channel.Open();
            channel.Closed  += this.OnChannelClosed;
            channel.Faulted += this.OnChannelClosed;


            this.board.Creatures.Clear();
            foreach (var creature in this.serviceProxy.GetCreatures())
            {
                this.board.Creatures.Add(creature);
            }
        }
Ejemplo n.º 23
0
        public ViewModelLoader()
        {
            unityContainer = new UnityContainer();

            RegisterTypes();

            string kinectSetting = ConfigurationManager.AppSettings["KinectService"].ToString();
            string sourceSetting = ConfigurationManager.AppSettings["SourceService"].ToString();
            string boardSetting  = ConfigurationManager.AppSettings["BoardService"].ToString();
            string helpSetting   = ConfigurationManager.AppSettings["HelpService"].ToString();


            kinectService = unityContainer.Resolve <IKinectService>(kinectSetting);
            sourceService = unityContainer.Resolve <ISourceService>(sourceSetting);
            boardService  = unityContainer.Resolve <IBoardService>(boardSetting);
            helpService   = unityContainer.Resolve <IHelpService>(helpSetting);

            var prop           = DesignerProperties.IsInDesignModeProperty;
            var isInDesignMode = (bool)DependencyPropertyDescriptor
                                 .FromProperty(prop, typeof(FrameworkElement))
                                 .Metadata.DefaultValue;

            if (!isInDesignMode)
            {
                kinectService.Initialize();
                sourceService.Initialize();
                helpService.Initialize();
            }
        }
Ejemplo n.º 24
0
 public CustomerController(
     ITransactionService transactionService,
     ICustomerPlanService customerPlanService,
     IPlanService planService,
     ICommonServices services,
     IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings, TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext, IStoreContext storeContext,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     ICustomerRegistrationService customerRegistrationService,
     ITaxService taxService, RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings, AddressSettings addressSettings, ForumSettings forumSettings,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IPictureService pictureService, INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICustomerActivityService customerActivityService,
     MediaSettings mediaSettings,
     LocalizationSettings localizationSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     PluginMediator pluginMediator,
     IPermissionService permissionService,
     IBoardService boardService,
     ICountryService countryService,
     IAuthenticationService formsAuthenticationService,
     IAdCampaignService adCampaignService)
 {
     _planService                    = planService;
     _customerPlanService            = customerPlanService;
     _transactionService             = transactionService;
     _services                       = services;
     _authenticationService          = authenticationService;
     _dateTimeHelper                 = dateTimeHelper;
     _dateTimeSettings               = dateTimeSettings;
     _localizationService            = localizationService;
     _workContext                    = workContext;
     _storeContext                   = storeContext;
     _customerService                = customerService;
     _genericAttributeService        = genericAttributeService;
     _customerRegistrationService    = customerRegistrationService;
     _taxService                     = taxService;
     _customerSettings               = customerSettings;
     _currencyService                = currencyService;
     _priceFormatter                 = priceFormatter;
     _pictureService                 = pictureService;
     _newsLetterSubscriptionService  = newsLetterSubscriptionService;
     _customerActivityService        = customerActivityService;
     _mediaSettings                  = mediaSettings;
     _localizationSettings           = localizationSettings;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _pluginMediator                 = pluginMediator;
     _permissionService              = permissionService;
     _boardService                   = boardService;
     _countryService                 = countryService;
     _formsAuthenticationService     = formsAuthenticationService;
     _adCampaignService              = adCampaignService;
 }
Ejemplo n.º 25
0
 public KanbanController(UserManager <User> userManager, IBoardService boardService, IProjectService projectService, ILogService logService, IMapper mapper)
 {
     this.userManager    = userManager;
     this.boardService   = boardService;
     this.projectService = projectService;
     this.logService     = logService;
     this.mapper         = mapper;
 }
 public CheckBlockChainTransactionStatus(ICustomerService customerService,
                                         IBoardService boardService,
                                         ICommonServices services)
 {
     this._customerService = customerService;
     this._boardService    = boardService;
     this._services        = services;
 }
Ejemplo n.º 27
0
 public ForumPresenter()
 {
     _boardService = new BoardService();
     _forumRepository =new BoardForumRepository();
     _categoryRepository = new BoardCategoryRepository();
     _redirector = new Redirector();
     _webContext = new WebContext();
 }
Ejemplo n.º 28
0
 public EscapeMineHostedService(IFileService readFile, IBoardService boardService, IMineService mineService, IOptions <PathSetting> pathSetting, ITurtleService turtleService)
 {
     _pathSetting   = pathSetting;
     _turtleService = turtleService;
     _readFile      = readFile;
     _boardService  = boardService;
     _mineService   = mineService;
 }
Ejemplo n.º 29
0
 public ForumPresenter()
 {
     _boardService = ObjectFactory.GetInstance<IBoardService>();
     _forumRepository =new BoardForumRepository();
     _categoryRepository = new BoardCategoryRepository();
     _redirector = new Redirector();
     _webContext = new WebContext();
 }
Ejemplo n.º 30
0
 public ForumPresenter()
 {
     _boardService       = new BoardService();
     _forumRepository    = new BoardForumRepository();
     _categoryRepository = new BoardCategoryRepository();
     _redirector         = new Redirector();
     _webContext         = new WebContext();
 }
Ejemplo n.º 31
0
        //public BoardDataController(IBoardService service, IFileProvider fileProvider)
        public BoardDataController(IBoardService service)
        {
            this.boardService = service;

            //this.fileProvider = fileProvider;
            //this.boardService.SetServiceDirectory(
            //this.fileProvider.GetFileInfo(@"./Resources/BoardService"));
        }
Ejemplo n.º 32
0
 public BoardController(ILogger <CategoriesController> logger,
                        IMapper mapper,
                        IBoardService boardService)
 {
     _logger       = logger;
     _mapper       = mapper;
     _boardService = boardService;
 }
Ejemplo n.º 33
0
 public HomePageViewModel(INavigationService navigation, ICardService cardService, ICardGroupService cardGroupService, IBoardService boardService)
 {
     this.navigation       = navigation;
     this.cardService      = cardService;
     this.cardGroupService = cardGroupService;
     this.boardService     = boardService;
     InitializeCommands();
 }
Ejemplo n.º 34
0
 public BoardViewModel(IBoardService boardService)
 {
     _humanBoard    = new Board();
     _computerBoard = new Board();
     _boardService  = boardService;
     AddTiles(HumanTiles, _humanBoard);
     AddTiles(ComputerTiles, _computerBoard);
 }
Ejemplo n.º 35
0
        public ViewModel(IKinectService kinectService, ISourceService sourceService, IBoardService boardService, IHelpService helpService) 
        {
            user = new UserState();

            idleJobQueue = new Queue<Action>();

            this.helpService = helpService;
            this.helpService.NewHelpMessage += new EventHandler<HelpMessageEventArgs>(helpService_NewHelpMessage);

            this.kinectService = kinectService; 

            this.sourceService = sourceService;
            this.sourceService.EventsUpdated += new EventHandler<SourceEventArgs>(sourceService_EventsUpdated);

            this.boardService = boardService;
            this.boardService.BoardsUpdated += new EventHandler(boardService_BoardsChanged);

            appIdleTimer = new DispatcherTimer();
            appIdleTimer.Interval = TimeSpan.FromMinutes(1);
            appIdleTimer.Tick += new EventHandler(appIdle_Tick);
            appIdleTimer.Start();
        }
Ejemplo n.º 36
0
 public BoardController(IBoardService svc)
     : base()
 {
     this.service = svc;
 }
Ejemplo n.º 37
0
 public CardProgressAction(IProjectService projectService, IBoardService boardService)
 {
     _projectService = projectService;
     _boardService = boardService;
 }
Ejemplo n.º 38
0
 public CommonController(ISchoolService ObjService, IBoardService BoardService)
     : base()
 {
     this._SchoolService = ObjService;
     this._BoardService = BoardService;
 }
Ejemplo n.º 39
0
 public BoardsController(IRepository repository, IBoardService boardService)
 {
     _repository = repository;
     _boardService = boardService;
 }
Ejemplo n.º 40
0
 public AddForumPresenter()
 {
     _categoryService = new BoardService();
     forum = new BoardForum();
 }
Ejemplo n.º 41
0
 public CardMovedAction(ICardService cardService, IBoardService boardService)
 {
     _cardService = cardService;
     _boardService = boardService;
 }
Ejemplo n.º 42
0
 public RemoveAction(IBoardService boardService)
 {
     _boardService = boardService;
 }
Ejemplo n.º 43
0
 public AddCategoryPresenter()
 {
     _categoryService = new BoardService();
     boardCategory = new BoardCategory();
 }
Ejemplo n.º 44
0
 public ReOrderAction(IBoardService boardService)
 {
     _boardService = boardService;
 }
Ejemplo n.º 45
0
 public async Task InitAsync()
 {
     _board = IoC.Instance.Resolve<IBoardService>();
     //if (_board == null)
     //    throw new Exception("A board must be registered");
     var connectionString = string.Format("HostName={0}.azure-devices.net;DeviceId={1};SharedAccessKey={2}",
         SettingsViewModel.Default.Host, SettingsViewModel.Default.DeviceId, SettingsViewModel.Default.Key);
     _client = DeviceClient.CreateFromConnectionString(connectionString, TransportType.Http1);
     var data = new DeviceMetaData();
     data.Version = "1.0";
     data.IsSimulatedDevice = false;
     data.Properties.DeviceID = SettingsViewModel.Default.DeviceId;
     data.Properties.FirmwareVersion = "1.42";
     data.Properties.HubEnabledState = true;
     data.Properties.Processor = "ARM";
     data.Properties.Platform = "UWP";
     data.Properties.SerialNumber = "1234567890";
     data.Properties.InstalledRAM = "1024 MB";
     data.Properties.ModelNumber = "007-BOND";
     data.Properties.Manufacturer = "Raspberry";
     //data.Properties.UpdatedTime = DateTime.UtcNow;
     data.Properties.DeviceState = DeviceState.Normal;
     data.Commands.Add(new DeviceCommandDefinition("SwitchLight"));
     data.Commands.Add(new DeviceCommandDefinition("LightColor",
         new DeviceCommandParameterDefinition[] {
             new DeviceCommandParameterDefinition("Color", DeviceCommandParameterType.String)
         }));
     data.Commands.Add(new DeviceCommandDefinition("PingDevice"));
     data.Commands.Add(new DeviceCommandDefinition("StartTelemetry"));
     data.Commands.Add(new DeviceCommandDefinition("StopTelemetry"));
     data.Commands.Add(new DeviceCommandDefinition("ChangeSetPointTemp"));
     data.Commands.Add(new DeviceCommandDefinition("DiagnosticTelemetry"));
     data.Commands.Add(new DeviceCommandDefinition("ChangeDeviceState"));
     var content = JsonConvert.SerializeObject(data);
     await _client.SendEventAsync(new Message(Encoding.UTF8.GetBytes(content)));
 }
Ejemplo n.º 46
0
 public SchoolController(ISchoolService ObjService, IBoardService BoardService)
     : base()
 {
     this._ObjService = ObjService;
     _BoardService = BoardService;
 }
Ejemplo n.º 47
0
 public EditBoardColumnFormAction(IBoardService boardService)
 {
     _boardService = boardService;
 }