コード例 #1
0
    public AIGameState(
        //List<CardBehaviourScript> PlayerHand,
        List <CardBehaviourScript> PlayerTable,
        List <CardBehaviourScript> AIHand,
        List <CardBehaviourScript> AITable,
        HeroBehaviourScript _PlayerHero,
        HeroBehaviourScript _AIHero,
        int _MaxMana,
        int _PlayerMana,
        int _AIMana,
        BoardBehaviourScript.Turn _Turn,
        AIGameState Parent
        )
    {
        ParentState = Parent;
        if (ParentState == null)
        {
            Index = 0;
        }
        else
        {
            Index   = ParentState.Index + 1;
            Actions = new Queue <Action>(ParentState.Actions);
        }
        //PlayerHandCards = CardListCopier.DeepCopy(PlayerHand);
        PlayerTableCards = CardListCopier.DeepCopy(PlayerTable);
        PlayerHero       = _PlayerHero.Clone() as HeroBehaviourScript;

        AIHandCards  = CardListCopier.DeepCopy(AIHand);
        AITableCards = CardListCopier.DeepCopy(AITable);
        AIHero       = _AIHero.Clone() as HeroBehaviourScript;
        maxMana      = _MaxMana;
        PlayerMana   = _PlayerMana;
        AIMana       = _AIMana;
        turn         = _Turn;
        Calculate_State_Score();
        //if (Index <= BoardBehaviourScript.instance.AILEVEL)
        //{
        //    GetAllPlacingAction();
        //    GetAllAttackingActions();
        //}
        AllStates.Add(this);
    }
コード例 #2
0
    public AIGameState(
        //List<GameObject> PlayerHand,
        List <GameObject> PlayerTable,
        List <GameObject> AIHand,
        List <GameObject> AITable,
        HeroBehaviourScript _PlayerHero,
        HeroBehaviourScript _AIHero,
        int _MaxMana,
        int _PlayerMana,
        int _AIMana,
        BoardBehaviourScript.Turn _Turn,
        AIGameState Parent
        )
    {
        ParentState = Parent;
        if (ParentState == null)
        {
            Index = 0;
        }
        else
        {
            Index   = ParentState.Index + 1;
            Actions = new Queue <Action>(ParentState.Actions);
        }
        //List<CardBehaviourScript> _tempPlayerHand = new List<CardBehaviourScript>();
        //foreach (var item in PlayerHand)_tempPlayerHand.Add( item.GetComponent<CardBehaviourScript>());
        //PlayerHandCards = CardListCopier<List<CardBehaviourScript>>.DeepCopy(_tempPlayerHand);

        List <CardBehaviourScript> _tempPlayerTable = new List <CardBehaviourScript>();

        foreach (var item in PlayerTable)
        {
            _tempPlayerTable.Add(item.GetComponent <CardBehaviourScript>());
        }
        PlayerTableCards = CardListCopier.DeepCopy(_tempPlayerTable);

        PlayerHero = _PlayerHero.Clone() as HeroBehaviourScript;


        List <CardBehaviourScript> _tempAIHand = new List <CardBehaviourScript>();

        foreach (var item in AIHand)
        {
            _tempAIHand.Add(item.GetComponent <CardBehaviourScript>());
        }
        AIHandCards = CardListCopier.DeepCopy(_tempAIHand);

        List <CardBehaviourScript> _tempAITable = new List <CardBehaviourScript>();

        foreach (var item in AITable)
        {
            _tempAITable.Add(item.GetComponent <CardBehaviourScript>());
        }
        AITableCards = CardListCopier.DeepCopy(_tempAITable);

        AIHero     = _AIHero.Clone() as HeroBehaviourScript;
        maxMana    = _MaxMana;
        PlayerMana = _PlayerMana;
        AIMana     = _AIMana;
        turn       = _Turn;
        Calculate_State_Score();
        //if (Index<=BoardBehaviourScript.instance.AILEVEL)
        //{
        //    GetAllPlacingAction();
        //    GetAllAttackingActions();
        //}
        AllStates.Add(this);
    }