本文整理汇总了C#中Team类的典型用法代码示例。如果您正苦于以下问题:C# Team类的具体用法?C# Team怎么用?C# Team使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Team类属于命名空间,在下文中一共展示了Team类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnable
public override void OnEnable()
{
team = target as Team;
teamScroll = Vector2.zero;
base.OnEnable();
name = "Team";
}
示例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();
}
}
示例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;
}
示例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();
}
示例5: Form1
public Form1()
{
InitializeComponent();
t = new Team<Emp>(5);
//t = new TeamObj(5);
i = 0;
}
示例6: AddOpponents
public void AddOpponents(Team opposingTeam)
{
this.Player1.AddOpponents(opposingTeam);
this.Player2.AddOpponents(opposingTeam);
opposingTeam.Player1.AddOpponents(this);
opposingTeam.Player2.AddOpponents(this);
}
示例7: Match
public Match(Team homeTeam, Team awayTeam, Score score, int id)
{
this.HomeTeam = homeTeam;
this.AwayTeam = awayTeam;
this.Score = score;
this.Id = id;
}
示例8: RedTeamPossession
/// <summary>
/// Gives possesion of the ball to the red team.
/// </summary>
public void RedTeamPossession()
{
if (isServer)
{
possessionOfBall = Team.red;
}
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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 );
}
示例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;
}
示例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);
}