• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Team类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Team的典型用法代码示例。如果您正苦于以下问题:C# Team类的具体用法?C# Team怎么用?C# Team使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Team类属于命名空间,在下文中一共展示了Team类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnEnable

 public override void OnEnable()
 {
     team = target as Team;
     teamScroll = Vector2.zero;
     base.OnEnable();
     name = "Team";
 }
开发者ID:JoeOsborn,项目名称:SRPGCK,代码行数:7,代码来源:TeamEditor.cs


示例2: addButton_Click

 private void addButton_Click(object sender, EventArgs e)
 {
     if (teamBox.Text.Equals("")) {
         toolTip1.ToolTipTitle = "No Team Name!";
         toolTip1.Show("You cannot add a team without a name.", teamBox);
     }
     else {
         if (schoolform == null) {
             if (editorForm.school.Teams.ContainsKey(teamBox.Text)) {
                 ShowDuplicateError();
                 return;
             }
             else {
                 Team team = new Team(editorForm.school, teamBox.Text);
                 editorForm.school.Teams.Add(team.Name, team);
                 editorForm.AddTeamToList(team);
             }
         }
         else {
             if (schoolform.teams.Contains(teamBox.Text)) {
                 ShowDuplicateError();
                 return;
             }
             else {
                 schoolform.teams.Add(teamBox.Text.Trim());
                 schoolform.teamListView.Items.Add(teamBox.Text.Trim());
             }
         }
         Close();
     }
 }
开发者ID:pcluddite,项目名称:scholarbowl,代码行数:31,代码来源:AddTeam.cs


示例3: Class1

    public Class1()
    {
        List<Team> GenerateInitialPopulation()
        {
            var teams = new List<Team>();
            while(teams.Count < GeneticParameters.PopulationSize)
            {
                var randomTeam = CreateRandomTeam(PlayerPool);
                if (IsTeamValid(randomTeam))
                {
                    teams.Add(randomTeam);
                }
            }

            return teams;
        }

        Team CreateRandomTeam(IList<Player> allPlayers)
        {
            var team = new Team();
            team.Players.Add(SelectRandomPlayer(allPlayers, Position.Goalkeeper));
            team.Players.Add(SelectRandomPlayer(allPlayers, Position.Defender));
            team.Players.Add(SelectRandomPlayer(allPlayers, Position.Defender));
            //...
            return team;
        }
开发者ID:robinweston,项目名称:fantasyfootballrobot,代码行数:26,代码来源:Initial.cs


示例4: GiveTurn

 private static void GiveTurn( Team team )
 {
     currentTeam = team;
     allUnits.ForEach( u => { if( u.alive ) u.collider.enabled = true; } );
     currentTeam.units.ForEach( u => u.OnOurTurnStart() );
     God.OnTurnStart();
 }
开发者ID:choephix,项目名称:G11,代码行数:7,代码来源:TurnManager.cs


示例5: Form1

 public Form1()
 {
     InitializeComponent();
     t = new Team<Emp>(5);
     //t = new TeamObj(5);
     i = 0;
 }
开发者ID:prijuly2000,项目名称:Dot-Net,代码行数:7,代码来源:Form1.cs


示例6: AddOpponents

 public void AddOpponents(Team opposingTeam)
 {
     this.Player1.AddOpponents(opposingTeam);
     this.Player2.AddOpponents(opposingTeam);
     opposingTeam.Player1.AddOpponents(this);
     opposingTeam.Player2.AddOpponents(this);
 }
开发者ID:mikeparker,项目名称:tournamentmatching,代码行数:7,代码来源:Team.cs


示例7: Match

 public Match(Team homeTeam, Team awayTeam, Score score, int id)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
     this.Id = id;
 }
开发者ID:ivailojordanov,项目名称:Fundamental-Level,代码行数:7,代码来源:Match.cs


示例8: RedTeamPossession

 /// <summary>
 /// Gives possesion of the ball to the red team.
 /// </summary>
 public void RedTeamPossession()
 {
     if (isServer)
     {
         possessionOfBall = Team.red;
     }
 }
开发者ID:DrexelGoalBall,项目名称:goalBall,代码行数:10,代码来源:Possession.cs


示例9: AddHPCounter

 public AddHPCounter(float x, float y, Team team)
     : base(x, y)
 {
     _team = team;
     if (_team == Team.Blu) ((Text)Graphic).String = Teams.playerBlue._bonusHP.ToString();
     else ((Text)Graphic).String = Teams.playerRed._bonusHP.ToString();
 }
开发者ID:Kotvitskiy,项目名称:AoS,代码行数:7,代码来源:AdditionalHPCounter.cs


示例10: ComputerControlledTank

        public ComputerControlledTank(
            ISoundManager soundManager,
            World world, 
            Collection<IDoodad> doodads, 
            Team team, 
            Vector2 position, 
            float rotation,
            Random random, 
            DoodadFactory doodadFactory,
            IEnumerable<Waypoint> waypoints)
            : base(soundManager, world, doodads, team, position, rotation, doodadFactory)
        {
            this.world = world;
            this.random = random;
            this.states = new Dictionary<Type, ITankState>();
            this.states.Add(typeof(MovingState), new MovingState(world, this.Body, this, waypoints, random));
            this.states.Add(typeof(AttackingState), new AttackingState(world, this.Body, this));
            this.states.Add(typeof(TurningState), new TurningState(this.Body, this));
            this.currentState = this.states[typeof(MovingState)];
            this.currentState.StateChanged += this.OnStateChanged;
            this.currentState.NavigateTo();

            this.sensor = BodyFactory.CreateBody(world, this.Position);

            var shape = new CircleShape(6, 0);
            Fixture sensorFixture = this.sensor.CreateFixture(shape);
            sensorFixture.Friction = 1f;
            sensorFixture.IsSensor = true;
            sensorFixture.CollisionCategories = PhysicsConstants.SensorCategory;
            sensorFixture.CollidesWith = PhysicsConstants.PlayerCategory | PhysicsConstants.ObstacleCategory |
                                         PhysicsConstants.MissileCategory;
        }
开发者ID:aschearer,项目名称:BaconGameJam2012,代码行数:32,代码来源:ComputerControlledTank.cs


示例11: Create

        public bool Create(TeamModel model)
        {
            if (model == null) throw new ArgumentException("team");
            if (model.Name == null) throw new ArgumentException("name");

            using (var database = new BonoboGitServerContext())
            {
                var team = new Team
                {
                    Name = model.Name,
                    Description = model.Description
                };
                database.Teams.Add(team);
                if (model.Members != null)
                {
                    AddMembers(model.Members, team, database);
                }
                try
                {
                    database.SaveChanges();
                }
                catch (UpdateException)
                {
                    return false;
                }
            }

            return true;
        }
开发者ID:Aimeast,项目名称:Bonobo-Git-Server,代码行数:29,代码来源:EFTeamRepository.cs


示例12: RegditDetailScript

    private void RegditDetailScript()
    {
        if (!ClientScript.IsClientScriptBlockRegistered(this.GetType(), "RegditDetailScript"))
        {
            RM rm = new RM(ResourceFile.Msg);

            Team team = new Team();
            DialogWindow dw = team.DetailDialogWindow;

            //主键由 tem_id 改变成 team_guid
            //dw.AddUrlClientObjectParameter("KeyValue", "f_getSelectedNodeID(TVOrg)");
            dw.AddUrlClientObjectParameter("KeyValue", "getTeamGuid(TVOrg)");
            dw.AddUrlClientObjectParameter("Mode", "mode");            
            dw.AddUrlClientObjectParameter("TeamId", "f_getSelectedNodeID(TVOrg)");//team_id
            dw.AddUrlClientObjectParameter("TeamName", "f_getSelectedNodeText(TVOrg)");
            dw.AddUrlClientObjectParameter("TeamTypeId", "getTeamTypeId(TVOrg)");            

            StringBuilder s = new StringBuilder();

            s.Append("function ShowDetail(mode,type)");
            s.Append("{");
            s.AppendFormat("if(mode != 'ADD' && !CheckSelected()) {{alert('{0}');return;}}", rm["PleaseSelectNode"]);
            s.Append("var returnValue = '';" + dw.GetShowModalDialogScript("returnValue"));
            s.Append("if(returnValue=='REFRESH'){refreshParentNode(mode,type);}");
            s.Append("}\n");

            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "RegditDetailScript", s.ToString(), true);
        }
    }
开发者ID:HeyWeiPan,项目名称:WarehouseControlSystem,代码行数:29,代码来源:TeamTree.aspx.cs


示例13: CalculateTeamLinkAverage

        private double CalculateTeamLinkAverage( Dictionary<Guid, Dictionary<Guid, Link>> links, Team team )
        {
            var linkValues = new List<double>();

            foreach ( User player in team.Members )
            {
                foreach ( User otherPlayer in team.Members )
                {
                    if ( player.Id == otherPlayer.Id )
                    {
                        continue;
                    }
                    if ( !links[player.Id].Keys.Contains( otherPlayer.Id ) )
                    {
                        linkValues.Add( .5 );
                        continue;
                    }
                    linkValues.Add( links[player.Id][otherPlayer.Id].GetWinLoss() );
                }
            }

            if ( linkValues.Count == 0 )
            {
                return .5;
            }

            return Enumerable.Average( linkValues );
        }
开发者ID:Breeto,项目名称:MatchMaker,代码行数:28,代码来源:LimitedLinkMatchupProposer.cs


示例14: Match

 public Match(Team home, Team away,int id,int homeTeamGoals, int awayTeamGoals)
 {
     this.homeTeam = home;
     this.awayTeam = away;
     this.score = new Score(homeTeamGoals,awayTeamGoals);
     this.id = id;
 }
开发者ID:KostaKanev,项目名称:myCodes,代码行数:7,代码来源:Match.cs


示例15: PutTeam

        public IHttpActionResult PutTeam(int id, Team team)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != team.Id)
            {
                return BadRequest();
            }

            db.Entry(team).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TeamExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:demarojones,项目名称:TeamAccount,代码行数:32,代码来源:TeamsController.cs


示例16: generateLabel

        /**
        *   Generates a label with text, a picturebox and another label.
        *   @parentPanel The panel that should add the created panel to it's controls.
        *   @team The team object containing data that'll be displayed such as the teams name and logo.
        *   @match The match object containing data that should be displayed.
        **/
        private void generateLabel(Panel parentPanel, Team team, Match match)
        {
            int _teamScore;
            if (match._team1 == team) {
                _teamScore = match._team1Score;
            } else {
                _teamScore = match._team2score;
            }

            Label labelname = new System.Windows.Forms.Label();
            labelname.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel, ((byte)(0)));
            labelname.Name = team._name;
            labelname.Size = new System.Drawing.Size(250, 15);
            labelname.Dock = System.Windows.Forms.DockStyle.Top;
            labelname.Text = String.Format("{0}", team._name);
            labelname.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(207)))), ((int)(((byte)(207)))));

            PictureBox pb = new PictureBox();
            pb.Size = new System.Drawing.Size(15, 15);
            pb.Dock = DockStyle.Right;
            pb.Image = team.getTeamLogo();

            Label score = new Label();
            score.Text = _teamScore.ToString();
            score.Dock = DockStyle.Right;
            score.Size = new System.Drawing.Size(15, 15);

            labelname.Controls.Add(score);
            labelname.Controls.Add(pb);
            parentPanel.Controls.Add(labelname);
        }
开发者ID:Isola92,项目名称:NeckBoard,代码行数:37,代码来源:Widget.cs


示例17: BlueTeamPossession

 /// <summary>
 /// Gives possesion of the ball to the blue team.
 /// </summary>
 public void BlueTeamPossession()
 {
     if (isServer)
     {
         possessionOfBall = Team.blue;
     }
 }
开发者ID:DrexelGoalBall,项目名称:goalBall,代码行数:10,代码来源:Possession.cs


示例18: IsOnMyTeam

 public bool IsOnMyTeam(Team team)
 {
     if (team == null) {
         return false;
     }
     return team.teamNumber == this.teamNumber;
 }
开发者ID:millwardesque,项目名称:PixelWar3131,代码行数:7,代码来源:Team.cs


示例19: FindNearestTeam

 public static Transform FindNearestTeam(Team team, Vector3 fromPosition, float maxDistance)
 {
     Transform target = null;
     if (_targetables.ContainsKey(team))
     {
         var targetCandidates = _targetables[team];
         var smallestDistanceSquared = Mathf.Infinity;
         if (targetCandidates.Any())
         {
             foreach (var candidate in targetCandidates)
             {
                 if (candidate != null)
                 {
                     var toTarget = candidate.position - fromPosition;
                     if (toTarget.sqrMagnitude < maxDistance*maxDistance)
                     {
                         if (toTarget.sqrMagnitude < smallestDistanceSquared)
                         {
                             smallestDistanceSquared = toTarget.sqrMagnitude;
                             target = candidate;
                         }
                     }
                 }
             }
         }
         return target;
     }
     return null;
 }
开发者ID:talford2,项目名称:SpaceX,代码行数:29,代码来源:Targeting.cs


示例20: CheckTransferValidity

        private static TransferValidity CheckTransferValidity(Transfer transfer, Team currentTeam)
        {
            if (transfer.PlayerIn == null || transfer.PlayerOut == null)
            {
                return TransferValidity.PlayerIsNull;
            }

            if (currentTeam.Players.Any(p => p.Id == transfer.PlayerIn.Id))
            {
                return TransferValidity.PlayerTransferredInAlreadyInTeam;
            }

            //player transferred out must have been in original team
            if (currentTeam.Players.All(p => p.Id != transfer.PlayerOut.Id))
            {
                return TransferValidity.PlayerTransferredOutNotOriginallyInTeam;
            }

            if (transfer.PlayerIn.Position != transfer.PlayerOut.Position)
            {
                return TransferValidity.TransferedPlayersNotInSamePosition;
            }

            return TransferValidity.Valid;
        }
开发者ID:robinweston,项目名称:fantasyfootballrobot,代码行数:25,代码来源:TransferValidator.cs



注:本文中的Team类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TeamCityClient类代码示例发布时间:2022-05-24
下一篇:
C# Teacher类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap