private void HandleTurnsDone(object sender, EventArgs e) { RemovedTarget?.Invoke(this, EventArgs.Empty); _whosTurn = null; UnTarget(); }
public MatchWrestler InstantiateWrester(WrestlerData wrestlerData, int teamNumber, int positionInTeam, Match matchManager, InMatchWrestlingTargetDeterminator targetDeterminator, Ring ring) { MatchWrestler matchWrestler = Instantiate(wrestlerPrefab); RingPosition startingPosition = null; switch (teamNumber) { case 0: startingPosition = GetStartingRingPosition(_teamOne, positionInTeam); break; case 1: startingPosition = GetStartingRingPosition(_teamTwo, positionInTeam); break; case 2: startingPosition = GetStartingRingPosition(_teamThree, positionInTeam); break; case 3: startingPosition = GetStartingRingPosition(_teamFour, positionInTeam); break; default: break; } //TODO: Set wrestlers position in the world here. matchWrestler.InitializeWrestler(matchManager, wrestlerData, targetDeterminator, ring, startingPosition); ; return(matchWrestler); }
private void UnTarget() { if (_isTargeted != null) { _isTargeted.BeUnTargeted(); _isTargeted = null; } }
private void SetNewTarget(MatchWrestler wrestler) { _isTargeted = wrestler; _isTargeted.BeTargeted(); NewTarget?.Invoke(this, new MatchWresterGenericEventArgs() { wrestler = wrestler }); }
public void EndCurrentTurn() { if (currentTurn != null) { nameTextFeild.text = ""; currentTurn = null; matchTurnOrder.EndCurrentTurn(); } }
private List <MatchWrestler> CreateTeam(List <WrestlerDataScriptableObject> wrestlers, int teamPosition) { List <MatchWrestler> teamList = new List <MatchWrestler>(); for (int i = 0; i < wrestlers.Count; i++) { MatchWrestler matchWrestler = _wrestlerFactory.InstantiateWrester(wrestlers[i].wrestlerData, teamPosition, i, this, _targetDeterminator, _ring); matchMrestlers.Add(matchWrestler.GetHashCode().ToString(), matchWrestler); RegisterForWrestlerEvents(matchWrestler); teamList.Add(matchWrestler); } return(teamList); }
private void HandleNewWrestlersTurn(object sender, MatchWresterGenericEventArgs e) { _whosTurn = e.wrestler; }
private void SetNewTarget(MatchWresterGenericEventArgs e) { _isTargeted = e.wrestler; _isTargeted.BeTargeted(); NewTarget?.Invoke(this, e); }
private void RegisterForWrestlerEvents(MatchWrestler matchWrestler) { matchWrestler.ReadyForMyTurn += HandleReadyFoMyTurn; matchWrestler.EndTurn += HandleWrestlerEndTurn; }
private void HandleNewTarget(object sender, MatchWresterGenericEventArgs e) { target = e.wrestler; canvasGroup.alpha = 1f; canvasGroup.interactable = true; }
private void HandleRemovedTarget(object sender, EventArgs e) { target = null; canvasGroup.alpha = 0.3f; canvasGroup.interactable = false; }
private void HandleNewWrestlersTurn(object sender, MatchWresterGenericEventArgs e) { currentTurn = e.wrestler; nameTextFeild.text = e.wrestler.Name; }
public void AddWrestlerToTurnQue(MatchWrestler wrestler) { _turnOrder.Add(wrestler); wrestler.LostSpeed += HandleWrestlerLostSpeed; }