I have two List in which color IDs are stored. I need to compare List adress1PlayerColorList and List bufferPropertyList and if there are the same values, then increase the variable int SameColorsCount. For example, I have two identical values in adress1PlayerColorList and bufferPropertyList, how can I make it so that after checking two Lists, my SameColorsCount value gives the number of identical elements?
int adress1PlayerColor = new int();
List<int> adress1PlayerColorList = new List<int>();
for (int i = 0; i < adress1Player.Count; i++)
{
adress1PlayerColor = boardInstance.PropertyColor(adress1Player[i]);
adress1PlayerColorList.Add(adress1PlayerColor);
}
ArrayList bufferProperty = playerManager.RequestPlayerProperties(indexNextPlayer);
List<int> bufferPropertyList = new List<int>();
int PlayerOwnPropertyColor = new int();
for (int i = 0; i < bufferProperty.Count; i++)
{
PlayerOwnPropertyColor = boardInstance.PropertyColor((int)bufferProperty[i]);
bufferPropertyList.Add(PlayerOwnPropertyColor);
}