Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        TeamActions = TrackActions();

        if (Input.GetKeyDown(KeyCode.P) || TeamActions <= 0)
        {
            //Trigger End Turn Events (eg: spawn units)
            if (PhaseEnd != null)
            {
                PhaseEnd.Invoke(CurrentTeam, TurnCount);
            }
            if (PhaseEndLate != null)
            {
                PhaseEndLate.Invoke(CurrentTeam, TurnCount);
            }

            //Pass Turn Control over to the next valid team.
            PassTurnControl();

            //Trigger Start Turn Events (eg: heal from fort)
            if (PhaseStart != null)
            {
                PhaseStart.Invoke(CurrentTeam, TurnCount);
            }
            if (PhaseStartLate != null)
            {
                PhaseStartLate.Invoke(CurrentTeam, TurnCount);
            }
        }
    }
Exemple #2
0
 public void registerPhase(PhaseUpdator phase, PhaseStart start = null)
 {
     _PhaseList.Add(new PhaseItem(phase, start));
 }
Exemple #3
0
 private void Start()
 {
     PhaseStart.Invoke(CurrentTeam, TurnCount);
 }
Exemple #4
0
 public PhaseItem(PhaseUpdator upd, PhaseStart stt)
 {
     IsStart = false;
     Starter = stt;
     Updator = upd;
 }