public Team GetTeam_Opponent(TeamSide _side) { if(_side == TeamSide.SIDE_HOME) return teams[(int)TeamSide.SIDE_AWAY]; else return teams[(int)TeamSide.SIDE_HOME]; }
public Team(TeamSide side, Platoon platoon) { _Side = side; _Platoon = platoon; _Platoon.SetSide(side); _Strategys = new int[(int)Strategy.Count]; if (_Platoon.Formation == Contingent.FormationType.Auxiliary) { _Front = new ITeammate[] { _Platoon.Teammates[0] }; int i = 0; _Back = (from teammate in _Platoon.Teammates let idx = i++ where idx > 0 select teammate).ToArray(); } if (_Platoon.Formation == Contingent.FormationType.Defensive) { _Back = new ITeammate[] { _Platoon.Teammates[0] }; int i = 0; _Front = (from teammate in _Platoon.Teammates let idx = i++ where idx > 0 select teammate).ToArray(); } }
public Platoon(TeamSide side, int idealFireteamSize) { Side = side; Squads = new List <Squad>(); SupportingRoles = 0; IdealFireteamSize = idealFireteamSize; }
public Team GetTeamByTeamSide(TeamSide _teamSide) { foreach(Team t in teams) { if(t.side == _teamSide) return t; } Debug.LogError ("Not able to find TeamSide for any of the teams in memory."); return teams [0]; }
// Add NPC GameObject to the list of Group AI void OnTriggerEnter(Collider col) { TeamSide collisionTeamSide = col.GetComponent <TeamSide>(); if (col.gameObject.tag == "NPC" && collisionTeamSide != null && (collisionTeamSide.playerTeam == playerTeamSide.playerTeam)) { listOfCollision.Add(col.gameObject); } }
// Use this for initialization void Start() { Team = TeamSide.Players; Health = 100f; if (GlobalData.p2wallBonus) { Health += GlobalData.p2wallBonusAmount; } }
public Team( TeamSide side ) { this.Side = side; Skill = 0; Players = new Dictionary<PlayerClass, List<Player>>( 4 ); Players[PlayerClass.Demo] = new List<Player>( 1 ); Players[PlayerClass.Scout] = new List<Player>( 2 ); Players[PlayerClass.Soldier] = new List<Player>( 2 ); Players[PlayerClass.Medic] = new List<Player>( 1 ); }
public Party(UnitEntity[] mainUnit, BannerUnit bannerUnit, TeamSide team, Party enemyParty) { this.members = mainUnit; for (int i = 0; i < mainUnit.Length; i++) { mainUnit[i].SetPartyId(this, team + i.ToString(), team == TeamSide.Player); } this.bannerUnit = bannerUnit; bannerUnit.SetPartyId(this, team + "banner", team == TeamSide.Player); this.team = team; this.enemyParty = enemyParty; }
public Team(FightEngine engine, TeamSide side) : base(engine) { if (side != TeamSide.Left && side != TeamSide.Right) throw new ArgumentException("Side must be either Left or Right", "side"); m_side = side; m_victorystatus = new VictoryStatus(this); m_display = new TeamDisplay(this); m_winhistory = new List<Win>(9); m_p1 = null; m_p2 = null; }
public void testTeamSide() { string team = "Gamma Squad"; string side = "CT"; string test = $"Team playing \"{side}\": {team}"; TeamSideParser parser = new TeamSideParser(); Assert.IsTrue(parser.IsMatch(test)); TeamSide data = parser.Parse(test); Assert.AreEqual(team, data.Team); Assert.AreEqual(side, data.CurentSide); }
public static string GetPrefix(TeamSide side) { switch (side) { case TeamSide.Left: return("p1"); case TeamSide.Right: return("p2"); default: throw new ArgumentOutOfRangeException(nameof(side)); } }
public static string GetMatePrefix(TeamMode mode, TeamSide side) { switch (side) { case TeamSide.Left: return(mode == TeamMode.Turns? "p1.teammate" : "p3"); case TeamSide.Right: return(mode == TeamMode.Turns ? "p2.teammate" : "p4"); default: throw new ArgumentOutOfRangeException(nameof(side)); } }
public Team(FightEngine engine, TeamSide side) : base(engine) { if (side != TeamSide.Left && side != TeamSide.Right) { throw new ArgumentException("Side must be either Left or Right", nameof(side)); } m_side = side; m_victorystatus = new VictoryStatus(this); m_winhistory = new List <Win>(9); m_p1 = null; m_p2 = null; }
public MatchBuilder <T> WithWinningTeam(TeamSide team) { if (team == TeamSide.Home) { match.HomeTeamScore = 1; match.AwayTeamScore = 0; } else { match.HomeTeamScore = 0; match.AwayTeamScore = 1; } return(this); }
private void SetUpAgentAndAnim() { agent = gameObject.AddComponent <NavMeshAgent>(); agent.speed = npcSpeed; anim = GetComponent <SoliderAnimScript>(); anim.setNpc(agent); character = GetComponent <CharacterScript>(); team = GetComponent <TeamSide>(); health = GetComponent <HealthScript>(); if (!agent) { Debug.Log("No NavMeshAgent attached to this npc"); } }
public void SetUp(UnitEntity unit, TeamSide teamSide) { this.unitData = unit.data; SetSprite(unitData.sprites[0]); switch (teamSide) { case TeamSide.Player: unitModel = unit; break; case TeamSide.Enemy: unitModel = unit; break; } unitModel.SetDisplay(this); }
public void Show(TeamSide winner, int winnerLives, int maxLives) { if (winner == TeamSide.Hippies) { hippiesText.text = winnerLives.ToString("00") + " / " + maxLives.ToString("00"); armyText.text = "00 / " + maxLives.ToString("00"); victoryText.text = "The Hippies Won !"; } else { armyText.text = winnerLives.ToString("00") + " / " + maxLives.ToString("00"); hippiesText.text = "00 / " + maxLives.ToString("00"); victoryText.text = "The Cops Won !"; } animator.SetTrigger("Go"); // Time.timeScale = 0f; }
public bool IsEnemyTeam(TeamSide value) { if (Team == TeamSide.Dark && value == TeamSide.Dark) { return(false); } if (Team == TeamSide.Dark || value == TeamSide.Dark) { return(true); } if (Team == TeamSide.Light || value == TeamSide.Light) { return(false); } return(Team != value); }
// Use this for initialization void Start() { // Setting the player's team side var comp = GetComponentsInParent <TeamSide>(); playerTeamSide = comp[0]; listOfCollision = new List <GameObject>(); isAssembled = false; isAnchorTaken = new List <bool>(); // Populating the Boolean List foreach (GameObject obj in listOfAnchorPoints) { isAnchorTaken.Add(false); } }
public void AddScore(Tournament tournament, Match match, TeamSide scoredSide, string playerId, string remark = "") { var scoredTeam = scoredSide == TeamSide.Home ? match.HomeTeam : match.AwayTeam; var playerList = tournamentRepo.GetPlayersByTeam(tournament.Id, scoredTeam.Id); var player = playerList.SingleOrDefault(x => x.Id == playerId); if (player == null) { if (String.IsNullOrEmpty(remark)) { throw new PlayerNotFoundException(); } else { player = tournamentRepo.GetPlayerById(playerId); } } tournamentRepo.AddMatchScore(tournament.Id, match.Id, scoredTeam.Id, player.Id, remark); }
void OnTriggerEnter(Collider other) { TeamSide teamSide = other.GetComponent <TeamSide>(); NpcSimple npc = other.GetComponent <NpcSimple>(); if (npc != null) { npc.IsAtCapturePoint = true; } if (teamSide != null) { switch (teamSide.playerTeam) { case TeamSide.TeamEnum.None: { // Debug.Log("None is capturing"); break; } case TeamSide.TeamEnum.RedTeam: { ++redPlayersInside; //Debug.Log(redPlayersInside + ": Red is capturing"); break; } case TeamSide.TeamEnum.BlueTeam: { ++bluePlayersInside; //Debug.Log(bluePlayersInside + ": Blue is capturing"); break; } } } }
private string GetTeamEvents(TeamSide teamSide) { List <string> teamEventsAsStringArray = new List <string>(); switch (teamSide) { case TeamSide.Home: foreach (var teamEvent in Home_team_events) { teamEventsAsStringArray.Add(teamEvent.ToString()); } break; case TeamSide.Away: foreach (var teamEvent in Away_team_events) { teamEventsAsStringArray.Add(teamEvent.ToString()); } break; } return(string.Join("\n\t", teamEventsAsStringArray.ToArray())); }
void Start() { this.Team = TeamSide.Players; MainCam = GameObject.FindGameObjectWithTag("MainCamera"); if (transform.parent.tag == "Pl2") { this.Health = 120f; SecondCam = GameObject.FindGameObjectWithTag("CameraP1"); if (GlobalData.p2armor == true) { Health += GlobalData.armorAmount; } } else { this.Health = 60f; if (GlobalData.p1armor == true) { Health += GlobalData.armorAmount; } SecondCam = GameObject.FindGameObjectWithTag("CameraP2"); if (transform.parent.Find("pl1-shield") != null) { shields = transform.parent.Find("pl1-shield").GetComponent <ShieldScript>(); } } cts = GameObject.FindGameObjectWithTag("CameraTeller").GetComponent <CameraTellerScript>(); if (MaxHP == 0) { MaxHP = Health; } }
// Use this for initialization void Start() { side = GetComponent <TeamSide>(); healthText.GetComponent <TextMesh>().text = health.ToString(); damageTimer = 1.0f; switch (side.playerTeam) { case TeamSide.TeamEnum.None: healthText.GetComponent <TextMesh>().color = Color.white; break; case TeamSide.TeamEnum.RedTeam: healthText.GetComponent <TextMesh>().color = Color.red; break; case TeamSide.TeamEnum.BlueTeam: healthText.GetComponent <TextMesh>().color = Color.blue; break; default: healthText.GetComponent <TextMesh>().color = Color.white; break; } }
void OnTriggerExit(Collider other) { TeamSide teamSide = other.GetComponent <TeamSide>(); NpcSimple npc = other.GetComponent <NpcSimple>(); if (npc != null) { npc.IsAtCapturePoint = false; } if (teamSide != null) { switch (teamSide.playerTeam) { case TeamSide.TeamEnum.None: { //Debug.Log("None is capturing"); break; } case TeamSide.TeamEnum.RedTeam: { --redPlayersInside; //Debug.Log(redPlayersInside + ":Red capturing, red left"); break; } case TeamSide.TeamEnum.BlueTeam: { --bluePlayersInside; //Debug.Log(bluePlayersInside + ":blue capturing, blue left"); break; } } } }
void SwitchTurns() { ResetTimer (); teamOfTheTurn = GetTeam_Opponent (teamOfTheTurn).side;//Change team of the turn if( teamOfTheTurn == localTeamSide ) { GetTeamByTeamSide (localTeamSide).EnableAllPlayers (); } else { GetTeamByTeamSide (localTeamSide).DisbaleAllPlayerMovmentsAndBalls (); } }
public async Task <TracerPlayer> UpdateStatsAsync(long tpID) { if (scl == null) { scl = (await client.GetStaticChampionsAsync()); scl.Keys = new Dictionary <string, string>(); foreach (var k in scl.Data.Keys) { scl.Keys.Add(scl.Data[k].Id.ToString(), k); } } TracerPlayer tp = db.TracerPlayers.Include(t => t.Summoner) .Include(t => t.PlayerStats) .ThenInclude(t => t.championStats) .ThenInclude(x => x.Stats) .Where(t => t.Summoner.Id == (long)tpID).FirstOrDefault(); bool doneSome = false; if (tp.PlayerStats != null && tp.PlayerStats.championStats != null && tp.PlayerStats.championStats.Count > 0) { //Delete db trash.. foreach (ChampionStats cs in tp.PlayerStats.championStats) { db.Remove(cs); doneSome = true; } if (tp.PlayerStats.stats != null) { db.Remove(tp.PlayerStats.stats); doneSome = true; } if (tp.PlayerStats != null) { db.Remove(tp.PlayerStats); doneSome = true; } if (doneSome) { db.SaveChanges(); } } //check the db TracerDemo.Model.Stats generalStats = CleanStats(); DateTime lastTwoMonths = DateTime.Today.AddMonths(-2); var endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTimeKind.Utc); var beginTime = endTime.AddMonths(-2); IEnumerable <QueueType> rankedQueues = new[] { QueueType.TEAM_BUILDER_RANKED_SOLO }; MatchList matchList = await client.GetMatchListByAccountIdAsync (tp.Summoner.AccountId, rankedQueues : rankedQueues); if (matchList == null) { return(tp); } List <MatchReference> matchReferneces = matchList.Matches; if (matchReferneces == null) { return(tp); } PlayerStats tracerStats = new PlayerStats(); tracerStats.TracerPlayerId = tp.Id; Dictionary <long, ChampionStats> champDict = new Dictionary <long, ChampionStats>(); int i = 0; foreach (MatchReference mr in matchReferneces) { if (mr.Timestamp > beginTime && mr.Timestamp < endTime) { i++; } else { Console.WriteLine("All rpocessed"); break; } Console.WriteLine("Processing match " + i + " of " + matchReferneces.Count); int champId = mr.Champion; //bool firstGame = false; if (!champDict.ContainsKey(champId)) { ChampionStats cs = new ChampionStats { TracerPlayerId = tp.Id, ChampionId = champId, ChampionName = scl.Keys[champId.ToString()], Stats = CleanStats() }; champDict.Add(champId, cs); //firstGame = true; } Match m = await client.GetMatchAsync(mr.GameId); if (m == null) { continue; } int blueDeaths = 0; int blueAsists = 0; int blueKills = 0; int redDeaths = 0; int redAsists = 0; int redKills = 0; int playerKills = 0; int playerAssists = 0; int playerDeaths = 0; TeamSide playerSide = TeamSide.Team1; foreach (MatchParticipant mp in m.Participants) { switch (mp.TeamId) { case TeamSide.Team1: blueDeaths += mp.Stats.Deaths; blueAsists += mp.Stats.Assists; blueKills += mp.Stats.Kills; break; case TeamSide.Team2: redDeaths += mp.Stats.Deaths; redAsists += mp.Stats.Assists; redKills += mp.Stats.Kills; break; } if (mp.ChampionId == champId) { playerSide = mp.TeamId; MatchParticipantStats matchPlayerStats = mp.Stats; champDict[champId].Stats.Games += 1; generalStats.Games += 1; champDict[champId].Stats.Minutes += (float)m.GameDuration.TotalMinutes; generalStats.Minutes += (float)m.GameDuration.TotalMinutes; champDict[champId].Stats.MinutesXMatch = champDict[champId].Stats.Minutes / champDict[champId].Stats.Games; generalStats.MinutesXMatch = generalStats.Minutes / generalStats.Games; if (matchPlayerStats.Win) { champDict[champId].Stats.Wins += 1; generalStats.Wins += 1; } champDict[champId].Stats.WinRate = (champDict[champId].Stats.Wins * 1f) / ((champDict[champId].Stats.Games * 1f)); generalStats.WinRate = (generalStats.Wins * 1f) / (generalStats.Games * 1f); //Champion Wards champDict[champId].Stats.Wards += mp.Stats.WardsPlaced; champDict[champId].Stats.WardsKilled += mp.Stats.WardsKilled; champDict[champId].Stats.WardXmin = champDict[champId].Stats.Wards / champDict[champId].Stats.Minutes; champDict[champId].Stats.WardKillXmin = champDict[champId].Stats.WardsKilled / champDict[champId].Stats.Minutes; //General Wards generalStats.Wards += mp.Stats.WardsPlaced; generalStats.WardsKilled += mp.Stats.WardsKilled; generalStats.WardXmin = generalStats.Wards / generalStats.Minutes; generalStats.WardKillXmin = generalStats.WardsKilled / generalStats.Minutes; generalStats.Kills += mp.Stats.Kills; generalStats.Daths += mp.Stats.Deaths; generalStats.Asists += mp.Stats.Assists; generalStats.Minions += mp.Stats.TotalMinionsKilled; generalStats.MinionsMinute = generalStats.Minions / generalStats.Minutes; champDict[champId].Stats.Kills += mp.Stats.Kills; champDict[champId].Stats.Daths += mp.Stats.Deaths; champDict[champId].Stats.Asists += mp.Stats.Assists; champDict[champId].Stats.Minions += mp.Stats.TotalMinionsKilled; champDict[champId].Stats.MinionsMinute = champDict[champId].Stats.Minions / champDict[champId].Stats.Minutes; playerKills += mp.Stats.Kills; playerDeaths += mp.Stats.Deaths; playerAssists += mp.Stats.Assists; if (mp.Stats.FirstBloodKill || mp.Stats.FirstBloodAssist) { champDict[champId].Stats.FirstBlood += 1; generalStats.FirstBlood += 1; } } } switch (playerSide) { case TeamSide.Team1: generalStats.KillParticipation += redKills; generalStats.KillShare += redKills; generalStats.DeathShare += redDeaths; champDict[champId].Stats.KillParticipation += redKills; champDict[champId].Stats.KillShare += redKills; champDict[champId].Stats.DeathShare += redDeaths; break; case TeamSide.Team2: generalStats.KillParticipation += redKills; generalStats.KillShare += redKills; generalStats.DeathShare += redDeaths; champDict[champId].Stats.KillParticipation += redKills; champDict[champId].Stats.KillShare += redKills; champDict[champId].Stats.DeathShare += redDeaths; break; } } generalStats.KillParticipation = (generalStats.Kills + generalStats.Asists) / Math.Max(1f, generalStats.KillParticipation); generalStats.KillShare = (generalStats.Kills) / Math.Max(1f, generalStats.KillShare); generalStats.DeathShare = (generalStats.Daths) / Math.Max(1f, generalStats.DeathShare); generalStats.FirstBlood = (generalStats.FirstBlood / generalStats.Games); List <ChampionStats> championStats = champDict.Values.ToList(); tp.PlayerStatsId = tracerStats.Id; tp.IsProcesing = false; tp.LastUpdate = endTime.ToFileTimeUtc(); db.TracerPlayers.Update(tp); db.SaveChanges(); foreach (ChampionStats cs in championStats) { champDict[cs.ChampionId].Stats.KillParticipation = (champDict[cs.ChampionId].Stats.Kills + champDict[cs.ChampionId].Stats.Asists) / Math.Max(1f, champDict[cs.ChampionId].Stats.KillParticipation); champDict[cs.ChampionId].Stats.KillShare = (champDict[cs.ChampionId].Stats.Kills) / Math.Max(1f, champDict[cs.ChampionId].Stats.KillShare); champDict[cs.ChampionId].Stats.DeathShare = (champDict[cs.ChampionId].Stats.Daths) / Math.Max(1f, champDict[cs.ChampionId].Stats.DeathShare); champDict[cs.ChampionId].Stats.FirstBlood = champDict[cs.ChampionId].Stats.FirstBlood / champDict[cs.ChampionId].Stats.Games; db.Add(cs); } db.SaveChanges(); tracerStats.stats = generalStats; tracerStats.championStats = championStats; tracerStats.TracerPlayerId = tp.Id; tracerStats.player = tp; tracerStats.StatsId = generalStats.Id; db.Add(tracerStats); db.SaveChanges(); processingSummoners.Remove(tp.Summoner.Name); return(tp); }
void ITeammate.SetSide(TeamSide side) { _Side = side; }
void NewTurn() { ResetTimer (); teamOfTheTurn = GetTeam_Opponent (teamOfTheTurn).side;//Change team of the turn GetTeamByTeamSide (teamOfTheTurn).EnableAllPlayers ();//Enable team of the turn GetTeam_Opponent (teamOfTheTurn).DisbaleAllPlayerMovmentsAndBalls ();//Disable opposite team }
public GameTeam(Team team, TeamSide teamSide) { Team = team; TeamSide = teamSide; }
public Player(TeamSide side) { this.side = side; }
public Color GetTeamColorByTeamSide(TeamSide _teamSide) { if(_teamSide == 0) return Color.blue; else return Color.red; }
private Platoon ConvertTrainingSet(TrainingSet set, int numberOfPlayers, int minimumFireteamSize, TeamSide side) { var chosenPlatoon = ChoosePlatoon(set, numberOfPlayers, minimumFireteamSize); Platoon platoon = new Platoon(side, minimumFireteamSize); platoon.SupportingRoles = int.Parse(chosenPlatoon.players); int squadCounter = 0; foreach (TrainingSetPlatoonSquad trainingSquad in chosenPlatoon.Squad) { var squad = platoon.AddSquad((SquadSign)squadCounter); squad.SupportingRoles = int.Parse(trainingSquad.players); foreach (TrainingSetPlatoonSquadFireteam trainingFireteam in trainingSquad.Fireteam) { squad.AddFireTeam(int.Parse(trainingFireteam.players)); } squadCounter++; } return(platoon); }
public HumbleTeamBehaviour(TeamSide teamSide) { _teamSide = teamSide; }
internal void SetSide(TeamSide side) { foreach (var teammate in _ITeammates) { teammate.SetSide(side); } }
internal void SetSide(TeamSide side) { _Squad.SetSide(side); }
public AI(Difficulty difficulty, TeamSide side) : base(side) { this.difficulty = difficulty; }