Beispiel #1
0
 protected override void CleanUp()
 {
     if (CGME_Player.Cleanup() == true)
     {
         CGME_Player = null;
         Destroy(gameObject);
     }
 }
Beispiel #2
0
        // PLAYERS --------------
        public CGME.Player AddPlayer(CGME.Player new_player)
        {
            DispatchEvent(EngineEvent.AddChild, new_player, null);
            players.Add(new_player);

            new_player.Parent = this;

            return(new_player);
        }
Beispiel #3
0
        // PLAYERS -----------------

        public Player GetPlayer(CGME.Player _player)
        {
            foreach (Player player in players)
            {
                if (player == _player)
                {
                    return(player);
                }
            }

            return(null);
        }
Beispiel #4
0
        public override void Read()
        {
            //CGME.Player new_obj = CGME.CGFactory.Instantiate(node.type_string) as CGME.Player;

            if (node != null)
            {
                CGME_Player = new CGME.Player();
                CGME_Player.Read(node.data);
            }

            //new_obj = null;
        }
Beispiel #5
0
        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));
                    }
                }
            }
        }
Beispiel #6
0
//		public CGME.Player AddPlayer(string name){
//			Player new_player = new Player();
//			players.Add(new_player);
//			return new_player;
//		}

        public void RemovePlayer(CGME.Player player)
        {
            players.Remove(player);
        }
Beispiel #7
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Player = (CGME.Player)cgobj;
 }