Exemple #1
0
 public override void Read()
 {
     if (node != null)
     {
         CGME_Phase = new CGME.Phase();
         CGME_Phase.Read(node.data);
     }
 }
Exemple #2
0
 protected override void CleanUp()
 {
     if (CGME_Phase.Cleanup() == true)
     {
         CGME_Phase = null;
         Destroy(gameObject);
     }
 }
Exemple #3
0
        // GET/SET FUNCTIONS -----------------------------------------------------

        // LISTENERS



        // PHASES ---------------

        public Phase GetPhase(CGME.Phase _phase)
        {
            foreach (Phase phase in phases)
            {
                if (phase == _phase)
                {
                    return(phase);
                }
            }

            return(null);
        }
Exemple #4
0
        // LIST FUNCTIONS --------------------------------------------------------

        // PHASES --------------

        public Phase AddPhase(CGME.Phase new_phase)
        {
            DispatchEvent(EngineEvent.AddChild, new_phase, null);

            new_phase.Index = phases.Count;

            phases.Add(new_phase);

            new_phase.Parent = this;


            return(new_phase);
        }
        public void DebugComponents()
        {
            for (int rule_index = 0; rule_index < game.Phases_Size; rule_index++)              // FOR EACH PHASE

            {
                CGME.Phase phase = game.GetPhase(rule_index);
                Debug.Log("(ID:" + phase.Id + ") " + " -----PHASE: " + phase.CGType + DebugRes(phase));

                for (int phase_index = 0; phase_index < phase.Actions_Size; phase_index++)                  // FOR EACH ACTION

                {
                    CGME.Action action = phase.GetAction(phase_index);
                    Debug.Log("(ID:" + action.Id + ") " + "-------------ACTION:" + action.CGType);                      // + DebugRes(action));
                }
            }

            for (int game_index = 0; game_index < game.Players_Size; game_index++)              // FOR EACH PLAYER

            {
                CGME.Player player = game.GetPlayer(game_index);
                Debug.Log("(ID:" + player.Id + ") " + "PLAYER: " + player.CGType + DebugRes(player));

                for (int player_index = 0; player_index < player.Decks_Size; player_index++)                  // FOR EACH DECK

                {
                    CGME.Deck deck = player.GetDeck(player_index);
                    Debug.Log("(ID:" + deck.Id + ") " + "------DECK: " + deck.CGType + DebugRes(deck));

                    for (int deck_index = 0; deck_index < deck.Cards_Size; deck_index++)                      // FOR EACH CARD

                    {
                        CGME.Card card = deck.GetCard(deck_index);
                        Debug.Log("(ID:" + card.Id + ") " + "--------------CARD:" + card.CGType + DebugRes(card));
                    }
                }
            }
        }
Exemple #6
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Phase = (CGME.Phase)cgobj;
 }
Exemple #7
0
 public CGME.Phase NextPhase()
 {
     Iterate();
     CGME.Phase phase = GetPhase(PhaseIterator);
     return(phase);
 }
Exemple #8
0
 public void RemovePhase(CGME.Phase phase)
 {
     phases.Remove(phase);
 }
        // End phase and call next phase
        private void NextPhase()
        {
            running_phase = game.NextPhase();
            InitPhase();
//
        }
Exemple #10
0
 private void SetPhase(int index)
 {
     running_phase = game.GetPhase(index);
     InitPhase();
 }
Exemple #11
0
 // Start the new phase
 private void StartPhase(Phase phase)
 {
     running_phase = phase;
     running_phase.Start ();
 }
Exemple #12
0
        public bool DefinePhase(CGME.Phase phase)
        {
            if (phase == null){
                Debug.Log("Error - phase failed to load");
                return false;
            }

            running_phase = phase;
            running_phase.Start();
            Debug.Log ("SETTING NEW PHASE: " + running_phase.Name);
            return true;
        }