The method stops working when i call Add() but there are ZERO exeptions. this is in the piece class.
protected bool CopyInfoToGlobals(){
List<(int x, int y)> ew = range.Keys.ToList();
print($"dasf {ew.Count - 1}"); //prints numbers usally above 2
for(int r = 0; r < ew.Count - 1; r++){
print($"yfdhg {ew[r].x}, {ew[r].y}" );// prints once correctly
globals.PieceInteractions[ew[r].x, ew[r].y].Add(range[ew[r]]);//where i think the problem is
}
print("yuo");//never prints
return true
}
the second print() should call several times but only once. the last one never prints . this is for chess in unity2d.
when i did this nothing happens:
if(CopyInfoToGlobals()) print("sucsess at last"); else print(32);//it prints nothing
PieceInteractions decloration in globals which i dont think matters:
public static List<Piece.LocalBoardRepresention>[,] PieceInteractions = new List<Piece.LocalBoardRepresention>[8,8];
what range is:
public Dictionary<(int x, int y),LocalBoardRepresention> range = new Dictionary<(int x, int y), LocalBoardRepresention>();
idk if this matters either
public class LocalBoardRepresention
{
public Piece @this{internal set; get;}
public bool r{internal set; get;};
public bool l{internal set; get;};
public Piece p{internal set; get;};
}