Trying to make a list tuple of two Integers and after that adding something in it. Then comparing if x,y is one of the tuples in list tuple.
List<Tuple<int, int>> monsterPositions;
I instantly get error like this that it doesn't have Tuple:
Assets/TimeMap.cs(20,7): error CS0246: The type or namespace name `Tuple' could not be found. Are you missing an assembly reference?
I found out that I can add inside tuple like this:
monsterPositions.Add(randomX, randomY);
Then the hardest part is how can I compare the x and y in my Tuple list. I am trying to use Contains
but I don't know what is wrong with it.
monsterPositions.Contains(Tuple(x, y));
using System;
at top of your cs file? – Affluenceusing System;
, its needed for Tuple. – AffluenceTuples
. – PariahX
andY
properties instead of justItem1
andItem2
. – Petrinapetrine