예제 #1
0
        public SquareView()
        {
            InitializeComponent();

            boardContainer = Locator.Current.GetService <IBoardContainer>();

            this.OneWayBind(ViewModel, vm => vm.Value, v => v.SquareButton.Text);

            appearAnimation = new Animation(v => this.Scale = v, 0, 1);
        }
예제 #2
0
        public async Task ValidateAsync(IBoardContainer boardContainer)
        {
            if (boardContainer == null)
            {
                throw new ArgumentNullException(nameof(boardContainer));
            }

            var department = await GetBy(boardContainer);

            if (boardContainer.BoardId.HasValue && department == null)
            {
                throw new InvalidOperationException($"Board not found by id {boardContainer.BoardId}");
            }
        }
예제 #3
0
 public Task <IEnumerable <Issue> > GetByAsync(IBoardContainer board)
 {
     BoardGetService.ValidateAsync(board);
     return(IssueDataAccess.GetByAsync(board));
 }
예제 #4
0
 public async Task <IEnumerable <Issue> > GetByAsync(IBoardContainer board)
 {
     return(Mapper.Map <IEnumerable <Issue> >(
                await Context.Issue.Include(x => x.BoardId == board.BoardId)
                .ToListAsync()));
 }
예제 #5
0
 public SquareSpawner(IBoardContainer container = null)
 {
     boardContainer = container ?? Locator.Current.GetService <IBoardContainer>();
     random         = new Random();
 }
예제 #6
0
 private async Task <Board> GetBy(IBoardContainer boardContainer)
 {
     return(await BoardDataAccess.GetByAsync(boardContainer));
 }
예제 #7
0
 public async Task <Board> GetByAsync(IBoardContainer board)
 {
     return(board.BoardId.HasValue ?
            Mapper.Map <Board>(await Context.Board.FirstOrDefaultAsync(x => x.Id == board.BoardId))
         : null);
 }
예제 #8
0
 public GameLostChecker(IBoardContainer board = null)
 {
     boardContainer = board ?? Locator.Current.GetService <IBoardContainer>();
 }
예제 #9
0
 public SquareTranslator(IBoardContainer board = null)
 {
     this.boardContainer = board ?? Locator.Current.GetService <IBoardContainer>();
     lastMove            = MoveDirection.None;
     ChangeOccured       = true;
 }