public Task <IActionResult> UpsertTeamHolder(TeamHolderCreateRequest request) { var entity = this.BasicLayer.GetTeamHolderByTeamAndShooterId(request.TeamId, request.ShooterId); if (entity == null) { entity = new TeamHolder { ShooterId = request.ShooterId, TeamId = request.TeamId }; } entity.Description = request.Description; //Invocazione del service layer var validations = BasicLayer.UpsertTeamHolder(entity); if (validations.Count > 0) { return(BadRequestTask(validations)); } //Return contract return(Reply(ContractUtils.GenerateContract(entity))); }
private void Start() { _gameState = GameState.Prepare; _ballAllocator = transform.Find("game_flow/main").GetComponent <BallAllocator>(); _scoreHandler = transform.Find("game_flow/main").GetComponent <ScoreHandler>(); _teamHolder = transform.Find("game_flow/main").GetComponent <TeamHolder>(); //Set team Hard code for (int i = 0; i < Holes.Length; i++) { Holes[i].team = new TeamHolder.Team(Holes[i].name.Substring(Holes[i].name.Length - 1, 1), new GameObject[] { // teamHolder.GetChild((i*2)).gameObject, // teamHolder.GetChild( (i*2) + 1).gameObject }, Holes[i].teamColor); } //Set Camera ZoomInPosition _camera.SetUp(100, 13); GameStart(); }
public void AddPlayer(PlayerController player) { for (int i = 0; i < _teams.Count; i++) { if (_teams[i]._team == player.currentTeam) { PlayerScore playerScore = Instantiate(_playerScorePrefab, _teams[i].spawn); _gridLayout.spacing = new Vector2(0, _gridLayout.cellSize.y * _playerScores.Count); playerScore._player = player; playerScore.UpdateUI(); _playerScores.Add(playerScore); return; } } TeamHolder teamHolder = Instantiate(_holderPrefab, gameObject.transform); teamHolder._team = player.currentTeam; teamHolder.SetTeamText(); _teams.Add(teamHolder); AddPlayer(player); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var v = inflater.Inflate(Resource.Layout.fragment_tabstrip, container, false); loadingView = inflater.Inflate(Resource.Layout.loading_view, null, false); reflections = new List <Android.Support.V4.Widget.SwipeRefreshLayout>(); reflectionsList = new List <ListView> (); reflectionsAdapter = new List <ReflectionAdapter> (); if (profile.teams.Count > 0) { foreach (var team in profile.teams) { var rv = new Android.Support.V4.Widget.SwipeRefreshLayout(Activity); var lv = new ListView(Activity); var adp = new ReflectionAdapter(Activity); lv.Adapter = adp; rv.AddView(lv); TeamHolder th = new TeamHolder(); th.id = team.id; th.name = team.name; Console.WriteLine(team.slug); rv.Tag = th; reflections.Add(rv); reflectionsList.Add(lv); reflectionsAdapter.Add(adp); } } var uv = new Android.Support.V4.Widget.SwipeRefreshLayout(Activity); var ulv = new ListView(Activity); var ula = new ReflectionAdapter(Activity); ulv.Adapter = ula; uv.AddView(ulv); TeamHolder userTeam = new TeamHolder(); userTeam.id = -1; userTeam.name = "Me"; uv.Tag = userTeam; reflections.Add(uv); reflectionsList.Add(ulv); reflectionsAdapter.Add(ula); var wv = new Android.Support.V4.Widget.SwipeRefreshLayout(Activity); var wlv = new ListView(Activity); var wla = new ReflectionAdapter(Activity); wlv.Adapter = wla; wv.AddView(wlv); TeamHolder worldTeam = new TeamHolder(); worldTeam.id = -2; worldTeam.name = "World"; wv.Tag = worldTeam; reflections.Add(wv); reflectionsList.Add(wlv); reflectionsAdapter.Add(wla); currentLayout = reflections [0]; currentList = reflectionsList [0]; currentAdapter = reflectionsAdapter [0]; currentList.Scroll += HandleScroll; currentLayout.Refresh += HandleRefresh; adapter = new MyPagerAdapter(reflections); pager = v.FindViewById <ViewPager> (Resource.Id.pager); tabs = v.FindViewById <PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); tabs.OnPageChangeListener = this; return(v); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var v = inflater.Inflate(Resource.Layout.fragment_tabstrip, container, false); loadingView = inflater.Inflate(Resource.Layout.loading_view, null, false); refreshViews = new List <Android.Support.V4.Widget.SwipeRefreshLayout> (); leaderboardAdapters = new List <LeaderboardAdapter> (); leaderboardListViews = new List <ListView> (); if (profile.teams.Count > 0) { foreach (var team in profile.teams) { var leaderboardRefreshView = new Android.Support.V4.Widget.SwipeRefreshLayout(Activity); var leaderboardListView = new ListView(Activity); var leaderboardAdapter = new LeaderboardAdapter(Activity); leaderboardListView.Adapter = leaderboardAdapter; leaderboardRefreshView.AddView(leaderboardListView); TeamHolder th = new TeamHolder(); th.id = team.id; th.name = team.name; leaderboardRefreshView.Tag = th; refreshViews.Add(leaderboardRefreshView); leaderboardListViews.Add(leaderboardListView); leaderboardAdapters.Add(leaderboardAdapter); } } var lrv = new Android.Support.V4.Widget.SwipeRefreshLayout(Activity); var llv = new ListView(Activity); var lda = new LeaderboardAdapter(Activity); llv.Adapter = lda; lrv.AddView(llv); TeamHolder wth = new TeamHolder(); wth.id = -1; wth.name = "World"; lrv.Tag = wth; refreshViews.Add(lrv); leaderboardListViews.Add(llv); leaderboardAdapters.Add(lda); SetCurrentItems(0); adapter = new MyPagerAdapter(refreshViews); pager = v.FindViewById <ViewPager> (Resource.Id.pager); tabs = v.FindViewById <PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); tabs.OnPageChangeListener = this; // refreshView = v.FindViewById<Android.Support.V4.Widget.SwipeRefreshLayout> (Resource.Id.refreshView); // // refreshView.Refresh += async delegate { // var resp = await client.ExecuteGetTaskAsync(request); // var content = resp.Content; // var serializerSettings = new JsonSerializerSettings() { // NullValueHandling = NullValueHandling.Ignore, // DateParseHandling = DateParseHandling.None // }; // adapter.Leaderboard = JsonConvert.DeserializeObject<Core.Leaderboard.Leaderboard>(content, serializerSettings); // // refreshView.Refreshing = false; // UpdateView(); // }; // UpdateView (); return(v); }