Exemple #1
0
        private bool isFoundMatchCell(int i_FirstCellCardKey, out MemoryCell i_MatchMemoryCell)
        {
            bool result = false;

            i_MatchMemoryCell = null;

            foreach (var cellMemory in m_PlayerAI.Memory)
            {
                if (cellMemory.CardKey == i_FirstCellCardKey)
                {
                    result            = true;
                    i_MatchMemoryCell = cellMemory;
                    break;
                }
            }

            return(result);
        }
Exemple #2
0
        private void saveMemoryOrAddMove(MattLocation i_Location, int i_CardKey)
        {
            MemoryCell matchMemoryCell;

            if (m_PlayerAI.IsCellInMemory(i_Location) == false)
            {
                MemoryCell temp = new MemoryCell(i_Location, i_CardKey);
                if (isFoundMatchCell(temp.CardKey, out matchMemoryCell) == false)
                {
                    m_PlayerAI.Memory.Add(temp);
                }
                else
                {
                    m_PlayerAI.Moves.Add(temp);
                    m_PlayerAI.Moves.Add(matchMemoryCell);
                    m_PlayerAI.Memory.Remove(matchMemoryCell);
                }
            }
        }
Exemple #3
0
 public void AddNewMove(MemoryCell i_Move1, MemoryCell i_Move2) //// add the two chooses to the moves of AI
 {
     m_Moves.Add(i_Move1);
     m_Moves.Add(i_Move2);
 }