in a simple game i have 4 possible moves (up, down, left, right) for each player
public struct Point
{
public int x;
public int y;
}
Point[] directions = new Point[]
{
new Point() {x=0,y=1 },
new Point() {x=0,y=-1 },
new Point() {x=1,y=0 },
new Point() {x=-1,y=0 }
};
i have n players, for example 3 but this number is not constant.
i need enumerate all possibile moves into an array. for example:
player1: up, player2:up, player3:up
player1: up, player2:up, player3:left
player1: up, player2:up, player3:right
player1: up, player2:up, player3:down
player1: up, player2:left, player3:up
....
....
what is the best way to enumerate all possible moves of all players into an array?
the resulting array must be:
item[0] = {up,up,up};
item[1] = {up,up,down};
item[2] = {up,up,left};
item[3] = {up,up,right};
item[4] = {up,down,up};
....
please, can you help me?