internal IEnumerator OdSwitch() { if (teamSide == TeamSide.Left) { animator.Play("TeamStateLout"); } else { animator.Play("TeamStateRout"); } yield return(new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length)); switch (teamState) { case (TeamState.Offense): teamState = TeamState.Defense; teamStateImage.sprite = defenseSprite; teamStateImage.color = defense; teamStatBar.color = defense; break; case (TeamState.Defense): teamState = TeamState.Offense; teamStateImage.sprite = offenseSprite; teamStateImage.color = attack; teamStatBar.color = attack; break; } }
public ScoreboardViewModel(TeamState state, HorizontalAlignment horizontalPosition) { _state = state; HorizontalPosition = horizontalPosition; this.WhenAnyValue(x => x._state.Score).Subscribe(x => Score = x); this.WhenAnyValue(x => x._state.IsActiveTeam).Subscribe(x => IsActiveTeam = x); }
public TeamState GenerateState() { TeamState state = new TeamState(Id); state.Guid = Guid; state.Name = Name; return(state); }
/// <summary> /// 注册状态转换规则 /// </summary> /// <param name="curState">Current state.</param> /// <param name="trigger">Trigger.</param> /// <param name="nextState">Next state.</param> public void RegisterFSMRule(TeamState curState, TeamState nextState, TeamStateTrigger[] triggers) { int[] conditions = new int[triggers.Length]; for (int i = 0; i < triggers.Length; i++) { conditions [i] = (int)triggers [i]; } FSM.AddRule((int)curState, conditions, (int)nextState); }
private void Start() { currentTeamTurn = (TeamState)Random.Range(0, 2); textTeam1.text = GameManager.Instance.TeamName[0]; textTeam2.text = GameManager.Instance.TeamName[1]; TimeTurn = turnDuration; }
public void UpdateTeamState(int teamId, TeamState teamState) { int state = GetTeamStateTypeNumber(teamState); var oldTeams = Context.Teams.Find(teamId); oldTeams.State = state; Update(oldTeams); }
public TeamState CreateState() { TeamState state = new TeamState(Id, Guid, Name); for (int i = 0; i < Colonies.Length; i++) { Colonies[i].Statistik.CurrentAntCount = Colonies[i].Insects.Count; state.ColonyStates.Add(Colonies[i].ErzeugeInfo()); } return(state); }
// Use this for initialization void Start() { teamGroupGO.SetActive(true); presentsGroupGO.SetActive(false); elapsedTime = 0f; currentState = TeamState.FADING_IN; loadMainMenu = SceneManager.LoadSceneAsync("MainMenu"); loadMainMenu.allowSceneActivation = false; fadeScript.StartFadingToClear(fadeInTime); }
public void ChangeTurn() { if (currentTeamTurn == TeamState.Team1) { currentTeamTurn = TeamState.Team2; currentPlayerWormIndexTeam2++; } else { currentTeamTurn = TeamState.Team1; currentPlayerWormIndexTeam1++; } }
protected void UpdateAllinace() { TeamState state = Unions.instance.GetState(origin.team, GManager.instance.selfTeam); for (int i = 0; i < viewsAlliace.Count; i++) { if (state == viewsAlliace[i].state) { iconAlliace.sprite = viewsAlliace[i].img; break; } } }
public static int GetTeamStateTypeNumber(TeamState TeamState) { switch (TeamState) { case TeamState.All: return(0); case TeamState.NewUploaded: return(1); case TeamState.AssignedToEditor: return(2); case TeamState.AcceptedByEditor: return(3); case TeamState.RejectedByEditor: return(4); case TeamState.NeedToChangeByEditor: return(5); case TeamState.AssignedToReviewer: return(6); case TeamState.AcceptedByReviewer: return(7); case TeamState.RejectedByReviewer: return(8); case TeamState.NeedToChangeByReviewer: return(9); case TeamState.WaitForAuthor: return(10); case TeamState.Corrected: return(11); case TeamState.HasStructuralError: return(12); case TeamState.UnderReview: return(13); case TeamState.AssignedToVolume: return(14); case TeamState.WaitForEditorInChief: return(15); case TeamState.WaitForEditor: return(16); case TeamState.AcceptedByEditorInChief: return(17); case TeamState.RejectedByEditorInChief: return(18); case TeamState.NeedToChangeByEditorInChief: return(19); default: return(0); } }
public void CallBack_Update_TeamState(int num_left, int num_right) { int num_myteam = is_left_team ? num_left : num_right; int num_enemy = is_left_team ? num_right : num_left; float p_mytem = num_myteam / (float)GameManager.instance.Bot_Number_Per_Team; float p_enemy = num_enemy / (float)GameManager.instance.Bot_Number_Per_Team; if (Play_Style == AIStyle.OFFENSIVE) { if (p_mytem >= 0.25f && p_enemy >= 0.25f) { Team_State = TeamState.MM; } else if (p_mytem >= 0.25f && (p_enemy < 0.25f || num_enemy == 1)) { Team_State = TeamState.ML; } else if ((p_mytem < 0.25f || num_myteam == 1) && (p_enemy < 0.25f || num_enemy == 1)) { Team_State = TeamState.LL; } else { Team_State = TeamState.LM; } } else { if (p_mytem > 0.5f && p_enemy > 0.5f) { Team_State = TeamState.MM; } else if (p_mytem > 0.5f && (p_enemy <= 0.5f || num_enemy == 1)) { Team_State = TeamState.ML; } else if ((p_mytem <= 0.5f || num_myteam == 1) && (p_enemy <= 0.5f || num_enemy == 1)) { Team_State = TeamState.LL; } else { Team_State = TeamState.LM; } } }
private TeamState[] GetTeamsState(Game game) { var teams = game.PlayerGame .Select(pg => pg.Team) .Distinct() .ToArray(); TeamState[] teamStates = new TeamState[teams.Length]; int index = 0; foreach (var team in teams) { teamStates[index] = GetTeamState(game, team); index++; } return(teamStates); }
public Team(Game g, int id, Color c) { m_id = id; m_game = g; m_characters = new ArrayList(); m_state = TeamState.SEARCH; m_mat = new Material(Shader.Find("Standard")) { color = c, name = "Team " + id + " Material" }; m_graphicRoot = new GameObject(); m_graphicRoot.name = "Team " + id; m_graphicCharacterRoot = new GameObject(); m_graphicCharacterRoot.name = "characters"; m_graphicCharacterRoot.transform.parent = m_graphicRoot.transform; m_spawnPoint = new SpawnPoint(this); m_flag = new Flag(new Vector2(), this); m_target = null; }
public virtual void ReloadState(int frames) { var realmData = Context.Resolve <RealmData>(); _teams = new TeamState[realmData.TotalTeams]; for (var index = 0; index < _teams.Length; index++) { _teams[index] = new TeamState { SpawnPoints = realmData.SpawnPoints[index % realmData.SpawnPoints.Length].ToArray() }; } _states = new RealmState[frames]; for (var index = 0; index < frames; index++) { _states[index] = new RealmState { PlayerStates = new PlayerState[realmData.TotalPlayers] }; } }
private void ComputePlayedCardEffects( IOrderedEnumerable <Tuple <PlayCardEvent, Card> > cardsPlayedOnTeam, TeamState teamState) { teamState.PlayedCardEffects = EffectCardType.NONE; if (IsCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.ACCIDENT)) { teamState.PlayedCardEffects |= EffectCardType.ACCIDENT; } if (IsCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.FUEL)) { teamState.PlayedCardEffects |= EffectCardType.FUEL; } if (IsCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.TIRE)) { teamState.PlayedCardEffects |= EffectCardType.TIRE; } if (IsCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.SPEED_LIMIT)) { teamState.PlayedCardEffects |= EffectCardType.SPEED_LIMIT; } if (IsCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.TRAFFIC_LIGHT)) { teamState.PlayedCardEffects |= EffectCardType.TRAFFIC_LIGHT; } }
public void OD(TeamState teamState) { switch (teamState) { case (TeamState.Offense): this.teamState = TeamState.Offense; teamStateImage.sprite = offenseSprite; teamStateImage.color = attack; teamStatBar.color = attack; animator.enabled = true; break; case (TeamState.Defense): this.teamState = TeamState.Defense; teamStateImage.sprite = defenseSprite; teamStateImage.color = defense; teamStatBar.color = defense; animator.enabled = true; break; } }
public void SetUnion(Team _team1, Team _team2, TeamState uState) { if (_team1 == _team2) { return; } int index = FindUnionIndex(_team1, _team2); if (index < 0) { _Unions.Add(new p_unions() { Name = _team1.ToString() + _team2.ToString(), Team1 = _team1, Team2 = _team2, Union = uState, }); } else { _Unions[index].SetUnion(uState); } }
//public bool coolingDown; //void Update() //{ // if (coolingDown == true) // { // transform.GetChild((int)t).GetChild(0).GetComponent<Image>().fillAmount -= 1.0f / deduceValue * Time.deltaTime; // } //} public void UpdateNbPlayer(TeamState value) { int sum = 0; switch (value) { case TeamState.Team1: for (int i = 0; i < GameLoopManager.Instance.WormsTeam1.Count; i++) { sum += GameLoopManager.Instance.WormsTeam1[i].GetComponent <WormInfo>().Life; } break; case TeamState.Team2: for (int i = 0; i < GameLoopManager.Instance.WormsTeam2.Count; i++) { sum += GameLoopManager.Instance.WormsTeam2[i].GetComponent <WormInfo>().Life; } break; } transform.GetChild((int)value + 1).GetChild(0).GetComponent <Image>().fillAmount = ((float)sum / (float)maxPv); }
private void CalculateInvincibility( IOrderedEnumerable <Tuple <PlayCardEvent, Card> > cardsPlayedOnTeam, TeamState teamState) { teamState.InvincibleToAccidents = IsInvincibleCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.ACCIDENT ); teamState.InvincibleToFuel = IsInvincibleCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.FUEL ); teamState.InvincibleToTire = IsInvincibleCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.TIRE ); teamState.InvinciblePriority = IsInvincibleCardEffectPlayedForTeam( cardsPlayedOnTeam, EffectCardType.TRAFFIC_LIGHT | EffectCardType.SPEED_LIMIT ); }
public void NotifyEnemyFlagTaken() { m_state = TeamState.BRINGBACK; }
public void OnWormTakeDamage(TeamState team) { OnNbPlayerRefresh(team); }
private void render(object sender, PaintEventArgs e) { if (Visible && renderDevice != null) { if (watch.ElapsedMilliseconds > 40) { watch.Reset(); watch.Start(); Selection selectedItem = new Selection(); // Selektionsinfos zurücksetzen selectedItem.SelectionType = SelectionType.Nothing; selectedItem.Item = null; float distanceToSelectedItem = VIEWRANGE_MAX * VIEWRANGE_MAX; renderDevice.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.FromArgb(51, 153, 255), 1.0f, 0); renderDevice.BeginScene(); //// Falls schon ein Zustand da ist kann gezeichnet werden if (simulationState != null) { SimulationState currentState = simulationState; // Update Camera camera.Update(currentState.PlaygroundWidth, currentState.PlaygroundHeight); renderDevice.Transform.View = camera.ViewMatrix; Pickray pickray = camera.Pickray; Point mousePosition = camera.MousePosition; // render Playerground modelManager.SetPlaygroundSize(currentState.PlaygroundWidth, currentState.PlaygroundHeight); modelManager.RenderPlayground(); // render these preaty little, blue items... float distance; for (int i = 0; i < currentState.BugStates.Count; i++) { if ((distance = modelManager.RenderBug(currentState.BugStates[i], pickray, false)) > 0) { // select, if pickray collides with item if (distance < distanceToSelectedItem) { distanceToSelectedItem = distance; selectedItem.Item = currentState.BugStates[i]; selectedItem.SelectionType = SelectionType.Bug; } } } // Render sugar for (int i = 0; i < currentState.SugarStates.Count; i++) { if ((distance = modelManager.RenderSugar(currentState.SugarStates[i], pickray, false)) > 0) { // select, if pickray collides with item if (distance < distanceToSelectedItem) { distanceToSelectedItem = distance; selectedItem.Item = currentState.SugarStates[i]; selectedItem.SelectionType = SelectionType.Sugar; } } } // Render Fruit for (int i = 0; i < currentState.FruitStates.Count; i++) { if ((distance = modelManager.RenderFruit(currentState.FruitStates[i], pickray, false)) > 0) { // select, if pickray collides with item if (distance < distanceToSelectedItem) { distanceToSelectedItem = distance; selectedItem.Item = currentState.FruitStates[i]; selectedItem.SelectionType = SelectionType.Fruit; } } } // Colony-specific stuff int count = 0; for (int teamIndex = 0; teamIndex < currentState.TeamStates.Count; teamIndex++) { for (int colonyIndex = 0; colonyIndex < currentState.TeamStates[teamIndex].ColonyStates.Count; colonyIndex++) { ColonyState colony = currentState.TeamStates[teamIndex].ColonyStates[colonyIndex]; // Ensure available materials for that colony modelManager.PrepareColony(count); // Render Anthills for (int anthillIndex = 0; anthillIndex < colony.AnthillStates.Count; anthillIndex++) { if ( (distance = modelManager.RenderAnthill( count, colony.AnthillStates[anthillIndex], pickray, false)) > 0) // select, if pickray collides with item { if (distance < distanceToSelectedItem) { distanceToSelectedItem = distance; selectedItem.Item = colony.AnthillStates[anthillIndex]; selectedItem.SelectionType = SelectionType.Anthill; selectedItem.AdditionalInfo = colony.ColonyName; } } } // Render Ants for (int antIndex = 0; antIndex < colony.AntStates.Count; antIndex++) { if ( (distance = modelManager.RenderAnt( count, colony.AntStates[antIndex], pickray, false)) > 0) { // select, if pickray collides with item if (distance < distanceToSelectedItem) { distanceToSelectedItem = distance; selectedItem.Item = colony.AntStates[antIndex]; selectedItem.SelectionType = SelectionType.Ant; selectedItem.AdditionalInfo = colony.ColonyName; } } } count++; } } // Render Marker // This must happen at the end, cause of alpha-tranperency count = 0; for (int teamIndex = 0; teamIndex < currentState.TeamStates.Count; teamIndex++) { TeamState team = currentState.TeamStates[teamIndex]; for (int colonyIndex = 0; colonyIndex < team.ColonyStates.Count; colonyIndex++) { ColonyState colony = team.ColonyStates[colonyIndex]; for (int markerIndex = 0; markerIndex < colony.MarkerStates.Count; markerIndex++) { MarkerState marker = colony.MarkerStates[markerIndex]; modelManager.RenderMarker(count, marker); } count++; } } // Render Statistics in the upper left corner modelManager.RenderInfobox(currentState); // Render Info-Tag at selected item if (selectedItem.SelectionType != SelectionType.Nothing) { string line1; string line2; switch (selectedItem.SelectionType) { case SelectionType.Ant: AntState ameise = (AntState)selectedItem.Item; string name; if (!antNames.ContainsKey(ameise.Id)) { name = names[random.Next(names.Length)]; antNames.Add(ameise.Id, name); } else { name = antNames[ameise.Id]; } line1 = string.Format(Resource.HovertextAntLine1, name, selectedItem.AdditionalInfo); line2 = string.Format(Resource.HovertextAntLine2, ameise.Vitality); break; case SelectionType.Anthill: line1 = Resource.HovertextAnthillLine1; line2 = string.Format(Resource.HovertextAnthillLine2, selectedItem.AdditionalInfo); break; case SelectionType.Bug: BugState bugState = (BugState)selectedItem.Item; line1 = Resource.HovertextBugLine1; line2 = string.Format(Resource.HovertextBugLine2, bugState.Vitality); break; case SelectionType.Fruit: FruitState fruitState = (FruitState)selectedItem.Item; line1 = Resource.HovertextFruitLine1; line2 = string.Format(Resource.HovertextFruitLine2, fruitState.Amount); break; case SelectionType.Sugar: SugarState sugar = (SugarState)selectedItem.Item; line1 = Resource.HovertextSugarLine1; line2 = string.Format(Resource.HovertextSugarLine2, sugar.Amount); break; default: line1 = String.Empty; line2 = String.Empty; break; } // Text an Mausposition ausgeben if (line1 != String.Empty || line2 != String.Empty) { modelManager.RenderInfoTag(mousePosition, line1, line2); } } } renderDevice.EndScene(); renderDevice.Present(); } Application.DoEvents(); Invalidate(); } }
/// <summary> /// Reads a new simulation-state out of stream. /// </summary> /// <returns>New simulation-state or null, if stream is over</returns> public SimulationState Read() { // if stream is at his end, return null if (complete) { return(null); } // first block have to be a frame-start ISerializable block; BlockType blockType = serializer.Read(out block); // detect stream-end if (blockType == BlockType.StreamEnd) { complete = true; return(null); } // unexpected block-type if (blockType != BlockType.FrameStart) { throw new InvalidOperationException( string.Format( CultureInfo.CurrentCulture, Resource.AntvideoReaderInvalidBlockType, blockType)); } // block-loop while (blockType != BlockType.FrameEnd) { blockType = serializer.Read(out block); switch (blockType) { case BlockType.Ant: Ant ant = (Ant)block; antList.Add(ant.Id, ant); break; case BlockType.Anthill: Anthill anthill = (Anthill)block; anthillList.Add(anthill.Id, anthill); break; case BlockType.AntLost: Lost antLost = (Lost)block; antList.Remove(antLost.Id); break; case BlockType.AntUpdate: AntUpdate antUpdate = (AntUpdate)block; antList[antUpdate.Id].Update(antUpdate); break; case BlockType.Bug: Bug bug = (Bug)block; bugList.Add(bug.Id, bug); break; case BlockType.BugLost: Lost bugLost = (Lost)block; bugList.Remove(bugLost.Id); break; case BlockType.BugUpdate: BugUpdate bugUpdate = (BugUpdate)block; bugList[bugUpdate.Id].Update(bugUpdate); break; case BlockType.Caste: Caste caste = (Caste)block; casteList[caste.ColonyId].Add(caste.Id, caste); break; case BlockType.Team: Team team = (Team)block; teamList.Add(team.Id, team); colonyList.Add(team.Id, new Dictionary <int, Colony>()); break; case BlockType.Colony: Colony colony = (Colony)block; colonyList[colony.TeamId].Add(colony.Id, colony); casteList.Add(colony.Id, new Dictionary <int, Caste>()); break; case BlockType.ColonyUpdate: ColonyUpdate colonyUpdate = (ColonyUpdate)block; colonyList[colonyUpdate.TeamId][colonyUpdate.Id].Update(colonyUpdate); break; case BlockType.Frame: frame = (Frame)block; break; case BlockType.FrameUpdate: FrameUpdate frameUpdate = (FrameUpdate)block; frame.Update(frameUpdate); break; case BlockType.Fruit: Fruit fruit = (Fruit)block; fruitList.Add(fruit.Id, fruit); break; case BlockType.FruitLost: Lost fruitLost = (Lost)block; fruitList.Remove(fruitLost.Id); break; case BlockType.FruitUpdate: FruitUpdate fruitUpdate = (FruitUpdate)block; fruitList[fruitUpdate.Id].Update(fruitUpdate); break; case BlockType.Marker: Marker marker = (Marker)block; markerList.Add(marker.Id, marker); break; case BlockType.MarkerLost: Lost markerLost = (Lost)block; markerList.Remove(markerLost.Id); break; case BlockType.MarkerUpdate: MarkerUpdate markerUpdate = (MarkerUpdate)block; markerList[markerUpdate.Id].Update(markerUpdate); break; case BlockType.Sugar: Sugar sugar = (Sugar)block; sugarList.Add(sugar.Id, sugar); break; case BlockType.SugarLost: Lost sugarLost = (Lost)block; sugarList.Remove(sugarLost.Id); break; case BlockType.SugarUpdate: SugarUpdate sugarUpdate = (SugarUpdate)block; sugarList[sugarUpdate.Id].Update(sugarUpdate); break; } } // Detect streamend if ((BlockType)serializer.Peek() == BlockType.StreamEnd) { complete = true; } // Interpolate all elements and buildup state frame.Interpolate(); SimulationState state = frame.GenerateState(); foreach (Bug bug in bugList.Values) { bug.Interpolate(); state.BugStates.Add(bug.GenerateState()); } foreach (Fruit fruit in fruitList.Values) { fruit.Interpolate(); state.FruitStates.Add(fruit.GenerateState()); } foreach (Sugar sugar in sugarList.Values) { sugar.Interpolate(); state.SugarStates.Add(sugar.GenerateState()); } foreach (Team team in teamList.Values) { TeamState teamState = team.GenerateState(); state.TeamStates.Add(teamState); foreach (Colony colony in colonyList[team.Id].Values) { colony.Interpolate(); ColonyState colonyState = colony.GenerateState(); teamState.ColonyStates.Add(colonyState); foreach (Caste caste in casteList[colony.Id].Values) { colonyState.CasteStates.Add(caste.GenerateState()); } foreach (Anthill anthill in anthillList.Values) { if (anthill.ColonyId == colony.Id) { colonyState.AnthillStates.Add(anthill.GenerateState()); } } foreach (Ant ant in antList.Values) { if (ant.ColonyId == colony.Id) { ant.Interpolate(); colonyState.AntStates.Add(ant.GenerateState()); } } foreach (Marker marker in markerList.Values) { if (marker.ColonyId == colony.Id) { marker.Interpolate(); colonyState.MarkerStates.Add(marker.GenerateState()); } } } } // deliver return(state); }
private TeamState GetTeamState(Game game, int teamIndex) { if (teamIndex == 0) { return(null); } var teams = game.PlayerGame .Select(pg => pg.Team) .Distinct() .ToArray(); if (!teams.Contains(teamIndex)) { return(null); } var cardsPlayedOnTeam = game.GameEvent .Where(ge => ge.Type == GameEventType.PLAY_CARD) .Cast <PlayCardEvent>() .Where(pc => pc.TargetTeamIndex == teamIndex) .ToList() .Join( CardDefinitions.Cards, pc => pc.DrawCardEvent.CardIndex, cd => cd.CardId, (pc, cd) => Tuple.Create(pc, cd) ) .OrderByDescending(x => x.Item1.GameEventId); var teamState = new TeamState() { TeamIndex = teamIndex }; teamState.HasAccident = IsTeamUnderEffect( cardsPlayedOnTeam, EffectCardType.ACCIDENT ); teamState.IsOutOfFuel = IsTeamUnderEffect( cardsPlayedOnTeam, EffectCardType.FUEL ); teamState.HasFlatTire = IsTeamUnderEffect( cardsPlayedOnTeam, EffectCardType.TIRE ); teamState.IsUnderSpeedLimit = IsTeamUnderEffect( cardsPlayedOnTeam, EffectCardType.SPEED_LIMIT ); ComputePlayedCardEffects(cardsPlayedOnTeam, teamState); bool accidentPlayed = teamState.PlayedCardEffects.HasFlag(EffectCardType.ACCIDENT); bool outOfFuelPlayed = teamState.PlayedCardEffects.HasFlag(EffectCardType.FUEL); bool flatTirePlayed = teamState.PlayedCardEffects.HasFlag(EffectCardType.TIRE); // Une équipe peut partir si elle a joué un feu vert. // Elle doit aussi, pour chaque effet dans [accident, essence, pneus], // avoir joué la carte qui la contre si une carte d'effet négatif // a été jouée contre l'équipe (les trois ifs). // // Le booléen détermine aussi si une carte feu vert peut être jouée, // les ifs évitent qu'un feu vert peut être joué lorsqu'il y a bris // non-réglé. // teamState.CanGo = IsTeamUnderEffect( cardsPlayedOnTeam, EffectCardType.TRAFFIC_LIGHT ); if (accidentPlayed) { if (teamState.HasAccident) { teamState.CanGo = false; } } if (outOfFuelPlayed) { if (teamState.IsOutOfFuel) { teamState.CanGo = false; } } if (flatTirePlayed) { if (teamState.HasFlatTire) { teamState.CanGo = false; } } // Une équipe ne peut partir immédiatement après un bris. if (teamState.CanGo) { var cardsPlayedOnTeamWithOrder = cardsPlayedOnTeam .OrderBy(tu => tu.Item1.GameEventId) .Select((tu, inx) => Tuple.Create(tu.Item1, tu.Item2, inx)); var lastAccident = GetLastCardEffectPlayedForTeam( cardsPlayedOnTeamWithOrder, EffectCardType.ACCIDENT ); var lastFuel = GetLastCardEffectPlayedForTeam( cardsPlayedOnTeamWithOrder, EffectCardType.FUEL ); var lastTire = GetLastCardEffectPlayedForTeam( cardsPlayedOnTeamWithOrder, EffectCardType.TIRE ); var lastLight = GetLastCardEffectPlayedForTeam( cardsPlayedOnTeamWithOrder, EffectCardType.TRAFFIC_LIGHT ); if (lastAccident != null && lastAccident.Item3 > lastLight.Item3) { teamState.CanGo = false; } if (lastFuel != null && lastFuel.Item3 > lastLight.Item3) { teamState.CanGo = false; } if (lastTire != null && lastTire.Item3 > lastLight.Item3) { teamState.CanGo = false; } } teamState.IsBrokenDown = teamState.CurrentlyBrokenDown; teamState.DistanceTraveled = cardsPlayedOnTeam .Where(x => x.Item2.CardType == CardType.VALUE) .Sum(x => x.Item2.Value); CalculateInvincibility(cardsPlayedOnTeam, teamState); return(teamState); }
public Team(TeamState state) : base(state.Id, state.Guid, state.Name) { }
public static ScrumTeam GetScrumTeam(bool member = false, bool observer = false, TeamState state = TeamState.Initial, IList <EstimationResultItem> estimationResult = null, IList <EstimationParticipantStatus> estimationParticipants = null) { var result = new ScrumTeam { Name = TeamName, ScrumMaster = new TeamMember { Name = ScrumMasterName, Type = ScrumMasterType }, Members = new List <TeamMember> { new TeamMember { Name = ScrumMasterName, Type = ScrumMasterType } }, Observers = new List <TeamMember>(), State = state, AvailableEstimations = new List <Estimation> { new Estimation { Value = 0 }, new Estimation { Value = 0.5 }, new Estimation { Value = 1 }, new Estimation { Value = 2 }, new Estimation { Value = 3 }, new Estimation { Value = 5 }, new Estimation { Value = 8 }, new Estimation { Value = 13 }, new Estimation { Value = 20 }, new Estimation { Value = 40 }, new Estimation { Value = 100 }, new Estimation { Value = Estimation.PositiveInfinity }, new Estimation(), }, EstimationResult = estimationResult ?? new List <EstimationResultItem>(), EstimationParticipants = estimationParticipants ?? new List <EstimationParticipantStatus>() }; if (member) { result.Members.Add(new TeamMember { Name = MemberName, Type = MemberType }); } if (observer) { result.Observers.Add(new TeamMember { Name = ObserverName, Type = ObserverType }); } return(result); }
public void NotifyEnemyFlagDropped() { m_state = TeamState.REACH; }
// Update is called once per frame void Update() { switch (currentState) { case TeamState.FADING_IN: if (!fadeScript.FadingToClear) { elapsedTime = 0f; currentState = TeamState.TEAM; } break; case TeamState.TEAM: if (elapsedTime >= chromaTeamTime) { fadeScript.StartFadingToColor(fadeToPresentTime / 2); currentState = TeamState.FADING_OUT_TO_PRESENT; } else { elapsedTime += Time.deltaTime; } break; case TeamState.FADING_OUT_TO_PRESENT: if (!fadeScript.FadingToColor) { teamGroupGO.SetActive(false); presentsGroupGO.SetActive(true); fadeScript.StartFadingToClear(fadeToPresentTime / 2); currentState = TeamState.FADING_IN_TO_PRESENT; } break; case TeamState.FADING_IN_TO_PRESENT: if (!fadeScript.FadingToClear) { elapsedTime = 0f; currentState = TeamState.PRESENT; } break; case TeamState.PRESENT: if (elapsedTime >= presentsTime) { //fadeScript.StartFadingToColor(fadeToMenuTime); glitch.enabled = true; glitchSoundFx.Play(); elapsedTime = 0f; currentState = TeamState.GLITCH; } else { elapsedTime += Time.deltaTime; } break; case TeamState.FADING_OUT: if (!fadeScript.FadingToColor) { loadMainMenu.allowSceneActivation = true; } break; case TeamState.GLITCH: if (elapsedTime >= fadeToMenuTime) { glitchSoundFx.Stop(); loadMainMenu.allowSceneActivation = true; } else { elapsedTime += Time.deltaTime; } break; } }
/// <summary> /// Sets the state of the team tab /// </summary> /// <param name="state">TeamState to set team tab state to</param> public void SetTeamState(TeamState state) { State = state; }