/// <summary> /// Pesquisa e retorna o jogador do time e marcação pesqiusado. Tenha em mente /// que esta pesquisa pode retornar nula se o time adversário não tiver nenhum jogador nesta marcação /// </summary> /// <param name="campteam"></param> /// <param name="marcation"></param> /// <returns>Jogador na mesma marcação e ou nullo se não houver jogador do time nesta marcação</returns> public PlayerController GetPlayerInMarcation(CampTeam campteam, CampPlaceMarcation marcation) { CampTeam otherCampTeam = campteam == CampTeam.Team_A ? CampTeam.Team_B : CampTeam.Team_A; TeamManager team = GetTeamManager(otherCampTeam); PlayerController enemy = team.GetPlayerInMarcation(marcation); return(enemy); }
public CampPosition GetPosition(CampPlaceSide side, CampPlaceMarcation cpos, CampPlaceType ctype) { CampPosition pos = null; string key = CampPosition.GetKey(side, cpos, ctype); positions.TryGetValue(key, out pos); return(pos); }
public Transform GetMarcationPosition(PlayerController player, CampPlaceType placeType) { CampTeam campTeam = player.GetCampTeam(); CampPlaceSide side = GetTeamPlaceSide(campTeam); CampPlaceMarcation marcation = player.GetPlaceMarcation(); CampPosition campPosition = placesManager.GetPosition(side, marcation, placeType); return(campPosition.transform); }
public PlayerController GetPlayerInMarcation(CampPlaceMarcation marcation) { PlayerController result = null; if (players.Count > 0) { result = players.Find(r => r.GetPlaceMarcation() == marcation); } return(result); }
public static string GetKey(CampPlaceSide side, CampPlaceMarcation cpos, CampPlaceType ctype) { return(side.ToString() + cpos.ToString() + ctype.ToString()); }