예제 #1
0
    public static GenericSubPhase StartTemporarySubPhaseNew(string name, System.Type subPhaseType, Action callBack)
    {
        if (CurrentSubPhase != null)
        {
            CurrentSubPhase.Pause();
        }

        if (DebugManager.DebugPhases)
        {
            Debug.Log("Temporary phase " + subPhaseType + " is started directly");
        }
        GenericSubPhase previousSubPhase = CurrentSubPhase;

        CurrentSubPhase                  = (GenericSubPhase)System.Activator.CreateInstance(subPhaseType);
        CurrentSubPhase.Name             = name;
        CurrentSubPhase.CallBack         = callBack;
        CurrentSubPhase.PreviousSubPhase = previousSubPhase;

        if (previousSubPhase != null)
        {
            CurrentSubPhase.RequiredPlayer     = previousSubPhase.RequiredPlayer;
            CurrentSubPhase.RequiredPilotSkill = previousSubPhase.RequiredPilotSkill;
        }

        return(CurrentSubPhase);
    }
예제 #2
0
파일: Phases.cs 프로젝트: vitreuz/FlyCasual
    public static void GoBack(Type specificSubphaseToFinish = null)
    {
        DecisionSubPhase decisionSubphase = CurrentSubPhase.PreviousSubPhase as DecisionSubPhase;

        if (decisionSubphase != null)
        {
            decisionSubphase.DecisionWasPreparedAndShown = false;
        }

        Type subphaseToFinish = specificSubphaseToFinish ?? CurrentSubPhase.GetType();

        FinishSubPhase(subphaseToFinish);
        CurrentSubPhase.Resume();
    }
예제 #3
0
 public static void FinishSubPhase(System.Type subPhaseType)
 {
     if (CurrentSubPhase.GetType() == subPhaseType)
     {
         if (DebugManager.DebugPhases)
         {
             Debug.Log("Phase " + subPhaseType + "is finished directly");
         }
         Next();
     }
     else
     {
         Debug.Log("OOPS! YOU WANT TO FINISH " + subPhaseType + " SUBPHASE, BUT NOW IS " + CurrentSubPhase.GetType() + " SUBPHASE!");
     }
 }
예제 #4
0
    private static void CheckScheduledFinishes()
    {
        if (subPhasesToFinish.Count != 0)
        {
            List <System.Type> tempList = new List <System.Type>();
            foreach (var subPhaseType in subPhasesToFinish)
            {
                tempList.Add(subPhaseType);
            }

            foreach (var subPhaseType in tempList)
            {
                if (CurrentSubPhase.GetType() == subPhaseType)
                {
                    subPhasesToFinish.Remove(subPhaseType);
                    Next();
                }
            }
        }
    }
예제 #5
0
    public static void FinishSubPhase(System.Type subPhaseType)
    {
        if (CurrentSubPhase.GetType() == subPhaseType)
        {
            if (DebugManager.DebugPhases)
            {
                Debug.Log("Phase " + subPhaseType + "is finished directly");
            }
            Next();
        }
        else
        {
            Debug.Log("OOPS! YOU WANT TO FINISH " + subPhaseType + " SUBPHASE, BUT NOW IS " + CurrentSubPhase.GetType() + " SUBPHASE!");

            /*if (!subPhasesToFinish.Contains(subPhaseType))
             * {
             *  Debug.Log("Phase " + subPhaseType + " is planned to finish");
             *  subPhasesToFinish.Add(subPhaseType);
             * }*/
        }
    }
예제 #6
0
 public static void CallNextSubPhase()
 {
     CurrentSubPhase.CallNextSubPhase();
 }
예제 #7
0
 public static void Next()
 {
     //Debug.Log("NEXT - finish for: " + CurrentSubPhase);
     CurrentSubPhase.Next();
 }
예제 #8
0
    // TEMPORARY SUBPHASES

    public static void StartTemporarySubPhaseOld(string name, System.Type subPhaseType, Action callBack = null)
    {
        GenericSubPhase subphase = StartTemporarySubPhaseNew(name, subPhaseType, callBack);

        CurrentSubPhase.Start();
    }