// PRIVATE METHODS private PlayerStep checkIfSuitablePlayerStepSavedInList(PlayerStep i_PlayerStep) { int suitablePlayerStepIndex = 0; bool isPlayerStepFound = false; PlayerStep stepPlayerToReturn; for (int i = 0; i < this.r_ArtificialPlayerStepMemoryList.Count; i++) { if (!i_PlayerStep.Equals(this.r_ArtificialPlayerStepMemoryList[i])) { if (CheckCardMatch(i_PlayerStep, this.r_ArtificialPlayerStepMemoryList[i])) { suitablePlayerStepIndex = i; isPlayerStepFound = true; break; } } } if (isPlayerStepFound) { stepPlayerToReturn = this.r_ArtificialPlayerStepMemoryList[suitablePlayerStepIndex]; this.r_ArtificialPlayerStepMemoryList.RemoveAt(suitablePlayerStepIndex); } else { stepPlayerToReturn = GetRandomMachineStep(); } return(stepPlayerToReturn); }
private bool checkIfCurrentPlayerStepIsNotInList(PlayerStep i_PlayerStepToCheck) { bool resultToReturn = true; for (int i = 0; i < this.r_ArtificialPlayerStepMemoryList.Count; i++) { if (i_PlayerStepToCheck.Equals(this.r_ArtificialPlayerStepMemoryList[i])) { resultToReturn = false; } } return(resultToReturn); }