示例#1
0
        private void HandleTurnsDone(object sender, EventArgs e)
        {
            RemovedTarget?.Invoke(this, EventArgs.Empty);

            _whosTurn = null;
            UnTarget();
        }
示例#2
0
        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);
        }
示例#3
0
 private void UnTarget()
 {
     if (_isTargeted != null)
     {
         _isTargeted.BeUnTargeted();
         _isTargeted = null;
     }
 }
示例#4
0
 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();
     }
 }
示例#6
0
        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);
        }
示例#7
0
 private void HandleNewWrestlersTurn(object sender, MatchWresterGenericEventArgs e)
 {
     _whosTurn = e.wrestler;
 }
示例#8
0
 private void SetNewTarget(MatchWresterGenericEventArgs e)
 {
     _isTargeted = e.wrestler;
     _isTargeted.BeTargeted();
     NewTarget?.Invoke(this, e);
 }
示例#9
0
 private void RegisterForWrestlerEvents(MatchWrestler matchWrestler)
 {
     matchWrestler.ReadyForMyTurn += HandleReadyFoMyTurn;
     matchWrestler.EndTurn        += HandleWrestlerEndTurn;
 }
示例#10
0
 private void HandleNewTarget(object sender, MatchWresterGenericEventArgs e)
 {
     target                   = e.wrestler;
     canvasGroup.alpha        = 1f;
     canvasGroup.interactable = true;
 }
示例#11
0
 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;
 }